struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20031214-1.c
blobd680629010342e4476c810b2dfeeaa30ccbb3db5
1 /*
2 20031214-1.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #pragma disable_warning 85
10 #pragma disable_warning 93
11 #endif
13 /* PR optimization/10312 */
14 /* Originator: Peter van Hoof <p dot van-hoof at qub dot ac dot uk> */
16 /* Verify that the strength reduction pass doesn't find
17 illegitimate givs. */
19 struct
21 double a;
22 int n[2];
23 } g = { 0., { 1, 2}};
25 int k = 0;
27 void
28 b (int *j)
32 void
33 testTortureExecute (void)
35 int j;
37 for (j = 0; j < 2; j++)
38 k = (k > g.n[j]) ? k : g.n[j];
40 k++;
41 b (&j);
43 return;