aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59374-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59374-3.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59374-3.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59374-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59374-3.c
new file mode 100644
index 000000000..ab0014d8f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59374-3.c
@@ -0,0 +1,21 @@
+extern void abort (void);
+
+static struct X { void *a; void *b; } a, b;
+
+void __attribute__((noinline)) foo (void)
+{
+ void *tem = a.b;
+ a.b = (void *)0;
+ b.b = tem;
+ b.a = a.a;
+ a.a = tem;
+}
+
+int main()
+{
+ a.b = &a;
+ foo ();
+ if (b.b != &a)
+ abort ();
+ return 0;
+}