summaryrefslogtreecommitdiff
path: root/support/regression/tests/gcc-torture-execute-20100805-1.c
blob: 9f0e02370b7521611fb971035d67e8b7473a830e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
   20100805.c from the execute part of the gcc torture tests.
 */

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

unsigned int foo (unsigned int a, unsigned int b)
{
  unsigned i;
  a = a & 1;
  for (i = 0; i < b; ++i)
    a = a << 1 | a >> (sizeof (unsigned int) * 8 - 1);
  return a;
}

void
testTortureExecute (void)
{
  if (foo (1, sizeof (unsigned int) * 8 + 1) != 2)
    ASSERT (0);
  return;
}