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-20001228-1.c
blobffa748d9a2d24f52ae551b4343f054256d782f41
1 /*
2 20001228-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 int foo1(void)
13 union {
14 char a[sizeof (unsigned)];
15 unsigned b;
16 } u;
18 u.b = 0x01;
19 return u.a[0];
22 int foo2(void)
24 volatile union {
25 char a[sizeof (unsigned)];
26 unsigned b;
27 } u;
29 u.b = 0x01;
30 return u.a[0];
33 void
34 testTortureExecute (void)
36 if (foo1() != foo2())
37 ASSERT (0);
38 return;