PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / bitfld-6.c
blobb8c5cbd285859cd1bf556b79b31009c00fbe6ca0
1 /* { dg-require-effective-target int32plus } */
2 union U
4 const int a;
5 unsigned b : 20;
6 };
8 static union U u = { 0x12345678 };
10 /* Constant folding used to fail to account for endianness when folding a
11 union. */
13 int
14 main (void)
16 #ifdef __BYTE_ORDER__
17 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
18 return u.b - 0x45678;
19 #else
20 return u.b - 0x12345;
21 #endif
22 #endif
23 return 0;