struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-struct-cpy-1.c
blobb7a858f4b5f4d537acdae9bf1eb26ac6e4a5d158
1 /*
2 struct-cpy-1.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 /* powerpc64-linux gcc miscompiled this due to rs6000.c:expand_block_move
8 not setting mem aliasing info correctly for the code implementing the
9 structure assignment. */
11 struct termios
13 unsigned int a;
14 unsigned int b;
15 unsigned int c;
16 unsigned int d;
17 unsigned char pad[28];
20 struct tty_driver
22 unsigned char pad1[38];
23 struct termios t;
26 #if !(defined(__SDCC_mcs51) && defined(__SDCC_MODEL_SMALL)) && !defined(__SDCC_pdk14) // Lack of memory
27 static struct termios zero_t;
28 static struct tty_driver pty;
30 void ini (void)
32 pty.t = zero_t;
33 pty.t.a = 1;
34 pty.t.b = 2;
35 pty.t.c = 3;
36 pty.t.d = 4;
38 #endif
40 void
41 testTortureExecute (void)
43 #if !(defined(__SDCC_mcs51) && defined(__SDCC_MODEL_SMALL)) && !defined(__SDCC_pdk14) // Lack of memory
44 ini ();
45 if (pty.t.a != 1
46 || pty.t.b != 2
47 || pty.t.c != 3
48 || pty.t.d != 4)
49 ASSERT (0);
50 #endif
51 return;