PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / builtin-bswap-9.c
blob4cf28e94fd8a17fa9384b4ecd094b4816ec0ab75
1 /* { dg-do compile { target arm*-*-* alpha*-*-* ia64*-*-* i?86-*-* x86_64-*-* s390x-*-* powerpc*-*-* rs6000-*-* } } */
2 /* { dg-require-effective-target stdint_types } */
3 /* { dg-require-effective-target lp64 } */
4 /* { dg-options "-O2 -fdump-rtl-combine" } */
6 #include <stdint.h>
8 #define BS(X) __builtin_bswap64(X)
10 uint64_t foo1 (uint64_t a)
12 return BS (~ BS (a));
15 uint64_t foo2 (uint64_t a)
17 return BS (BS (a) & 0xA00000000);
20 uint64_t foo3 (uint64_t a)
22 return BS (BS (a) | 0xA00000000);
25 uint64_t foo4 (uint64_t a)
27 return BS (BS (a) ^ 0xA00000000);
30 uint64_t foo5 (uint64_t a, uint64_t b)
32 return BS (BS (a) & BS (b));
35 uint64_t foo6 (uint64_t a, uint64_t b)
37 return BS (BS (a) | BS (b));
40 uint64_t foo7 (uint64_t a, uint64_t b)
42 return BS (BS (a) ^ BS (b));
45 /* { dg-final { scan-rtl-dump-not "bswapdi" "combine" } } */