PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / gcc.dg / optimize-bswapsi-3.c
blob9418a83dfe391fa6d52916493e24a8953840eac6
1 /* { dg-do compile } */
2 /* { dg-require-effective-target bswap } */
3 /* { dg-require-effective-target stdint_types } */
4 /* { dg-options "-O2 -fdump-tree-bswap" } */
5 /* { dg-additional-options "-march=z900" { target s390-*-* } } */
7 typedef int SItype __attribute__ ((mode (SI)));
8 typedef int DItype __attribute__ ((mode (DI)));
10 /* This variant comes from optimize-bswapsi-1.c swap32_d. It detects a missing
11 cast of MARKER_BYTE_UNKNOWN to uint64_t for the CASE_CONVERT case for host
12 architecture where a left shift with too big an operand gives zero. */
14 SItype
15 swap32 (SItype in)
17 return (((in >> 0) & 0xFF) << 24)
18 | (((in >> 8) & 0xFF) << 16)
19 | (((((DItype) in) & 0xFF00FF0000llu) >> 16) << 8)
20 | (((in >> 24) & 0xFF) << 0);
23 /* { dg-final { scan-tree-dump-not "32 bit bswap implementation found at" "bswap" } } */