aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-1.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-1.c
new file mode 100644
index 000000000..2512db396
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-1.c
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-options "-fschedule-insns" { target scheduling } } */
+
+extern void abort (void);
+
+struct S {
+ int i;
+ int j;
+};
+
+struct U {
+ struct S s;
+} __attribute__((may_alias));
+
+int __attribute__((noinline,noclone))
+foo (struct U *p, struct U *q)
+{
+ int i;
+ q->s.j = 1;
+ i = p->s.i;
+ return i;
+}
+
+int main()
+{
+ int a[3];
+ int *p = a;
+ p[1] = 0;
+ if (foo ((struct U *)(p + 1), (struct U *)p) != 1)
+ abort ();
+ return 0;
+}