1 /*
2 struct-cpy-1.c from the execute part of the gcc torture tests.
3 */
4 
5 #include <testfwk.h>
6 
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.  */
10 
11 struct termios
12 {
13   unsigned int a;
14   unsigned int b;
15   unsigned int c;
16   unsigned int d;
17   unsigned char pad[28];
18 };
19 
20 struct tty_driver
21 {
22   unsigned char pad1[38];
23   struct termios t;
24 };
25 
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;
29 
ini(void)30 void ini (void)
31 {
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;
37 }
38 #endif
39 
40 void
testTortureExecute(void)41 testTortureExecute (void)
42 {
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;
52 }
53