PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / builtin-bswap-7.c
blobfe854416c40a677dce127253f1dfefcdd63b5987
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 "-O -fdump-rtl-combine" } */
6 /* The branch cost setting prevents the return value from being
7 calculated with arithmetic instead of doing a compare. */
8 /* { dg-additional-options "-mbranch-cost=0" { target branch_cost } } */
10 #include <stdint.h>
12 #define BS(X) __builtin_bswap64(X)
14 int foo1 (uint64_t a)
16 if (BS (a) == 0xA00000000)
17 return 1;
18 return 0;
21 int foo2 (uint64_t a)
23 if (BS (a) != 0xA00000000)
24 return 1;
25 return 0;
28 int foo3 (uint64_t a, uint64_t b)
30 if (BS (a) == BS (b))
31 return 1;
32 return 0;
35 int foo4 (uint64_t a, uint64_t b)
37 if (BS (a) != BS (b))
38 return 1;
39 return 0;
42 /* { dg-final { scan-rtl-dump-not "bswapdi" "combine" } } */