gcc/testsuite/gcc.c-torture/execute/20020920-1.c
raw| 1 | extern void abort (void); |
| 2 | extern void exit (int); |
| 3 | |
| 4 | struct B |
| 5 | { |
| 6 | int x; |
| 7 | int y; |
| 8 | }; |
| 9 | |
| 10 | struct A |
| 11 | { |
| 12 | int z; |
| 13 | struct B b; |
| 14 | }; |
| 15 | |
| 16 | struct A |
| 17 | f () |
| 18 | { |
| 19 | struct B b = { 0, 1 }; |
| 20 | struct A a = { 2, b }; |
| 21 | return a; |
| 22 | } |
| 23 | |
| 24 | int |
| 25 | main (void) |
| 26 | { |
| 27 | struct A a = f (); |
| 28 | if (a.z != 2 || a.b.x != 0 || a.b.y != 1) |
| 29 | abort (); |
| 30 | exit (0); |
| 31 | } |