PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / gcc.dg / builtin-bswap-8.c
blob3dbde6ba0ab41c6f2f3ef10fe14fe1ecfb9a584a
1 /* { dg-do compile { target arm*-*-* alpha*-*-* i?86-*-* powerpc*-*-* rs6000-*-* x86_64-*-* s390*-*-* } } */
2 /* { dg-require-effective-target stdint_types } */
3 /* { dg-options "-O2 -fdump-rtl-combine" } */
4 /* { dg-options "-O2 -fdump-rtl-combine -march=z900" { target s390-*-* } } */
6 #include <stdint.h>
8 #define BS(X) __builtin_bswap32(X)
10 uint32_t foo1 (uint32_t a)
12 return BS (~ BS (a));
15 uint32_t foo2 (uint32_t a)
17 return BS (BS (a) & 0xA0000);
20 uint32_t foo3 (uint32_t a)
22 return BS (BS (a) | 0xA0000);
25 uint32_t foo4 (uint32_t a)
27 return BS (BS (a) ^ 0xA0000);
30 uint32_t foo5 (uint32_t a, uint32_t b)
32 return BS (BS (a) & BS (b));
35 uint32_t foo6 (uint32_t a, uint32_t b)
37 return BS (BS (a) | BS (b));
40 uint32_t foo7 (uint32_t a, uint32_t b)
42 return BS (BS (a) ^ BS (b));
45 /* { dg-final { scan-rtl-dump-not "bswapsi" "combine" } } */