gcc/testsuite/gcc.c-torture/execute/bswap-3.c
raw| 1 | /* { dg-require-effective-target int32plus } */ |
| 2 | |
| 3 | int f(unsigned int a) __attribute__((noipa)); |
| 4 | int f(unsigned int a) |
| 5 | { |
| 6 | return ((__builtin_bswap32(a))>>24) & 0x3; |
| 7 | } |
| 8 | |
| 9 | |
| 10 | int g(unsigned int a) __attribute__((noipa)); |
| 11 | int g(unsigned int a) |
| 12 | { |
| 13 | return a&0x3; |
| 14 | } |
| 15 | |
| 16 | int main(void) |
| 17 | { |
| 18 | for (int b = 0; b <= 0xF; b++) |
| 19 | { |
| 20 | if (f(b) != g(b)) |
| 21 | __builtin_abort (); |
| 22 | } |
| 23 | return 0; |
| 24 | } |
| 25 |