gcc/testsuite/gcc.c-torture/execute/anon-1.c
raw| 1 | /* Copyright (C) 2001 Free Software Foundation, Inc. */ |
| 2 | |
| 3 | /* Source: Neil Booth, 4 Nov 2001, derived from PR 2820 - field lookup in |
| 4 | nested anonymous entities was broken. */ |
| 5 | |
| 6 | void abort (void); |
| 7 | |
| 8 | struct |
| 9 | { |
| 10 | int x; |
| 11 | struct |
| 12 | { |
| 13 | int a; |
| 14 | union |
| 15 | { |
| 16 | int b; |
| 17 | }; |
| 18 | }; |
| 19 | } foo; |
| 20 | |
| 21 | int |
| 22 | main(int argc, char *argv[]) |
| 23 | { |
| 24 | foo.b = 6; |
| 25 | foo.a = 5; |
| 26 | |
| 27 | if (foo.b != 6) |
| 28 | abort (); |
| 29 | |
| 30 | return 0; |
| 31 | } |