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" } */
5 
6 #include <stdint.h>
7 
8 #define BS(X) __builtin_bswap64(X)
9 
foo1(uint64_t a)10 uint64_t foo1 (uint64_t a)
11 {
12   return BS (~ BS (a));
13 }
14 
foo2(uint64_t a)15 uint64_t foo2 (uint64_t a)
16 {
17   return BS (BS (a) & 0xA00000000);
18 }
19 
foo3(uint64_t a)20 uint64_t foo3 (uint64_t a)
21 {
22   return BS (BS (a) | 0xA00000000);
23 }
24 
foo4(uint64_t a)25 uint64_t foo4 (uint64_t a)
26 {
27   return BS (BS (a) ^ 0xA00000000);
28 }
29 
foo5(uint64_t a,uint64_t b)30 uint64_t foo5 (uint64_t a, uint64_t b)
31 {
32   return BS (BS (a) & BS (b));
33 }
34 
foo6(uint64_t a,uint64_t b)35 uint64_t foo6 (uint64_t a, uint64_t b)
36 {
37   return BS (BS (a) | BS (b));
38 }
39 
foo7(uint64_t a,uint64_t b)40 uint64_t foo7 (uint64_t a, uint64_t b)
41 {
42   return BS (BS (a) ^ BS (b));
43 }
44 
45 /* { dg-final { scan-rtl-dump-not "bswapdi" "combine" } } */
46