struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20041019-1.c
blobfb8ee475f1b283c343a6f7c4e54778aacfc78f00
1 /*
2 20041019-1.c from the execute part of the gcc torture suite.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 int
12 ftest_store_ccp (int i)
14 int *p, a, b, c;
16 if (i < 5)
17 p = &a;
18 else if (i > 8)
19 p = &b;
20 else
21 p = &c;
23 *p = 10;
24 b = 3;
26 /* STORE-CCP was wrongfully propagating 10 into *p. */
27 return *p + 2;
30 int
31 ftest_store_copy_prop (int i)
33 int *p, a, b, c;
35 if (i < 5)
36 p = &a;
37 else if (i > 8)
38 p = &b;
39 else
40 p = &c;
42 *p = i;
43 b = i + 1;
45 /* STORE-COPY-PROP was wrongfully propagating i into *p. */
46 return *p;
50 void
51 testTortureExecute (void)
53 int x;
55 x = ftest_store_ccp (10);
56 ASSERT(x != 12);
58 x = ftest_store_copy_prop (9);
59 ASSERT(x != 9);
61 return;