builtin-has-attribute-4.c: Skip on 32-bit hppa*-*-hpux*.
[official-gcc.git] / gcc / testsuite / gcc.dg / builtin-bswap-7.c
blob35bcee3784794e859373db68c830a5e764c62868
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 param setting prevents the return value from being
7 calculated with arithmetic instead of doing a compare. */
8 /* { dg-additional-options "--param logical-op-non-short-circuit=0" } */
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" } } */