aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/testsuite/c-c++-common/torture/pr58794-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.8/gcc/testsuite/c-c++-common/torture/pr58794-1.c')
-rw-r--r--gcc-4.8/gcc/testsuite/c-c++-common/torture/pr58794-1.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc-4.8/gcc/testsuite/c-c++-common/torture/pr58794-1.c b/gcc-4.8/gcc/testsuite/c-c++-common/torture/pr58794-1.c
new file mode 100644
index 000000000..175629fec
--- /dev/null
+++ b/gcc-4.8/gcc/testsuite/c-c++-common/torture/pr58794-1.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+
+struct S0
+{
+ int f;
+};
+
+struct S1
+{
+ struct S0 f1;
+ volatile int f2;
+};
+
+struct S2
+{
+ struct S1 g;
+} a, b;
+
+static int *c[1][2] = {{0, (int *)&a.g.f2}};
+static int d;
+
+int
+main ()
+{
+ for (d = 0; d < 1; d++)
+ for (b.g.f1.f = 0; b.g.f1.f < 1; b.g.f1.f++)
+ *c[b.g.f1.f][d + 1] = 0;
+ return 0;
+}