struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20181120-1.c
blob99b16786e39420f6dfb92360028027fa1cbeb744
1 /*
2 20181120-1.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 /* PR rtl-optimization/85925 */
8 /* { dg-require-effective-target int32plus } */
9 /* Testcase by <sudi@gcc.gnu.org> */
11 int a, c, d;
12 volatile int b;
13 int *e = &d;
15 union U1 {
16 unsigned f0;
17 unsigned f1 : 15;
19 volatile union U1 u = { 0x4030201 };
21 void
22 testTortureExecute (void)
24 for (c = 0; c <= 1; c++) {
25 union U1 f = {0x4030201};
26 if (c == 1)
28 *e = f.f1;
31 if (d != u.f1)
32 ASSERT (0);
34 return;