Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-anon-1.c
blobe6f43609f38c5f90d6de5578734ea69393b4f19b
1 /*
2 anon-1.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c11
10 /* Copyright (C) 2001 Free Software Foundation, Inc. */
12 /* Source: Neil Booth, 4 Nov 2001, derived from PR 2820 - field lookup in
13 nested anonymous entities was broken. */
15 struct
17 int x;
18 struct
20 int a;
21 union
23 int b;
26 } foo;
27 #endif
29 void
30 testTortureExecute (void)
32 #ifdef __SDCC
33 foo.b = 6;
34 foo.a = 5;
36 if (foo.b != 6)
37 ASSERT (0);
39 return;
40 #endif