aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/bswap-3.c
blob: 633711ec3a88efc86f16470e959e4aaaba464731 (plain)
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
/* { dg-require-effective-target int32plus } */

int f(unsigned int a) __attribute__((noipa));
int f(unsigned int a)
{
  return ((__builtin_bswap32(a))>>24) & 0x3;
}


int g(unsigned int a) __attribute__((noipa));
int g(unsigned int a)
{
  return a&0x3;
}

int main(void)
{
  for (int b = 0; b <= 0xF; b++)
    {
      if (f(b) != g(b))
	__builtin_abort ();
    }
  return 0;
}