struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20030613-1.c
blobc18c95b4150078bbfe3681973f89773cc21c5fd5
1 /*
2 20030613-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 // TODO: Enable when sdcc supports struct assignment!
12 #if 0
13 /* PR optimization/10955 */
14 /* Originator: <heinrich.brand@fujitsu-siemens.com> */
16 /* This used to fail on SPARC32 at -O3 because the loop unroller
17 wrongly thought it could eliminate a pseudo in a loop, while
18 the pseudo was used outside the loop. */
20 #define COMPLEX struct CS
22 COMPLEX {
23 long x;
24 long y;
28 static COMPLEX CCID (COMPLEX x)
30 COMPLEX a;
32 a.x = x.x;
33 a.y = x.y;
35 return a;
39 static COMPLEX CPOW (COMPLEX x, int y)
41 COMPLEX a;
42 a = x;
44 while (--y > 0)
45 a=CCID(a);
47 return a;
51 static int c5p (COMPLEX x)
53 COMPLEX a,b;
54 a = CPOW (x, 2);
55 b = CCID( CPOW(a,2) );
57 return (b.x == b.y);
59 #endif
61 void
62 testTortureExecute (void)
64 #if 0
65 COMPLEX x;
67 x.x = -7;
68 x.y = -7;
70 if (!c5p(x))
71 ASSERT(0);
73 return;
74 #endif