struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20030913-1.c
blobaa23575a6088ce5d88fd09674dd6a3013688fc02
1 /*
2 20030913-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 /* Assignments via pointers pointing to global variables were being killed
12 by SSA-DCE. Test contributed by Paul Brook <paul@nowt.org> */
14 int globl;
16 void
17 fn2(int ** q)
19 *q = &globl;
22 void foo(void)
24 int *p;
26 fn2(&p);
28 *p=42;
31 void
32 testTortureExecute (void)
34 foo();
35 ASSERT(globl == 42);
36 return;