PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr60454.c
blobceec45e699ff4f78ec83d9f4a26ad9ec69e79c9f
1 #ifdef __UINT32_TYPE__
2 typedef __UINT32_TYPE__ uint32_t;
3 #else
4 typedef unsigned uint32_t;
5 #endif
7 #define __fake_const_swab32(x) ((uint32_t)( \
8 (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \
9 (((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \
10 (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 8) | \
11 (((uint32_t)(x) & (uint32_t)0x0000ff00UL) ) | \
12 (((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24)))
14 /* Previous version of bswap optimization would detect byte swap when none
15 happen. This test aims at catching such wrong detection to avoid
16 regressions. */
18 __attribute__ ((noinline, noclone)) uint32_t
19 fake_swap32 (uint32_t in)
21 return __fake_const_swab32 (in);
24 int main(void)
26 if (sizeof (uint32_t) * __CHAR_BIT__ != 32)
27 return 0;
28 if (fake_swap32 (0x12345678UL) != 0x78567E12UL)
29 __builtin_abort ();
30 return 0;