struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-pr65215-1.c
blob61d5e6b6d5c4e21f130ab393d81e17db0a1338e1
1 /*
2 pr65215-1.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 #include <limits.h>
13 /* PR tree-optimization/65215 */
15 static inline unsigned int
16 foo (unsigned int x)
18 return (x >> 24) | ((x >> 8) & 0xff00) | ((x << 8) & 0xff0000) | (x << 24);
21 unsigned int
22 bar (unsigned long long *x)
24 return foo (*x);
27 void
28 testTortureExecute (void)
30 if (CHAR_BIT != 8 || sizeof (unsigned int) != 4 || sizeof (unsigned long long) != 8)
31 return;
33 unsigned long long l = foo (0xdeadbeefU) | 0xfeedbea800000000ULL;
34 if (bar (&l) != 0xdeadbeefU)
35 ASSERT (0);