aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/anon-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.c-torture/execute/anon-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/execute/anon-1.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/anon-1.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/anon-1.c
new file mode 100644
index 000000000..98a9ed71d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/anon-1.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* Source: Neil Booth, 4 Nov 2001, derived from PR 2820 - field lookup in
+ nested anonymous entities was broken. */
+
+struct
+{
+ int x;
+ struct
+ {
+ int a;
+ union
+ {
+ int b;
+ };
+ };
+} foo;
+
+int
+main(int argc, char *argv[])
+{
+ foo.b = 6;
+ foo.a = 5;
+
+ if (foo.b != 6)
+ abort ();
+
+ return 0;
+}