struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20020215-1.c
blob4f0d425035124e21d5741ca346829ed34d5b504f
1 /*
2 20020215-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 /* Test failed on an architecture that:
13 - had 16-bit registers,
14 - passed 64-bit structures in registers,
15 - only allowed SImode values in even numbered registers.
17 Before reload, s.i2 in foo() was represented as:
19 (subreg:SI (reg:DI 0) 2)
21 find_dummy_reload would return (reg:SI 1) for the subreg reload,
22 despite that not being a valid register. */
24 #if 0 // Todo: enable when compound literals are supported!
25 struct s
27 short i1;
28 long i2;
29 short i3;
32 struct s foo (struct s s)
34 s.i2++;
35 return s;
37 #endif
39 void
40 testTortureExecute (void)
42 #if 0 // Todo: enable when compound literals are supported!
43 struct s s = foo ((struct s) { 1000, 2000L, 3000 });
44 if (s.i1 != 1000 || s.i2 != 2001L || s.i3 != 3000)
45 ASSERT (0);
46 #endif