aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr42237.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr42237.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr42237.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr42237.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr42237.c
new file mode 100644
index 000000000..58db8660c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr42237.c
@@ -0,0 +1,32 @@
+struct A
+{
+ int p;
+};
+
+struct B
+{
+ struct A n;
+ struct A m;
+ int x;
+ int y;
+ int z;
+};
+
+extern int g1, g2;
+
+static void __attribute__((noinline)) foo (struct B *b)
+{
+ int t;
+
+ t = b->n.p;
+ g1 = t;
+ b->n.p = t+1;
+ g2 = b->m.p;
+
+ b->m = b->n;
+}
+
+void bar (struct B *b)
+{
+ foo (b);
+}