summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gcc.dg/tree-ssa/20041008-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/20041008-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20041008-1.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20041008-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20041008-1.c
new file mode 100644
index 00000000000..ca24427b65c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20041008-1.c
@@ -0,0 +1,38 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+struct A {
+ int x;
+ int y;
+};
+
+baz (struct A *a)
+{
+ a->x = 3;
+ a->y = 2;
+}
+
+foo (int i)
+{
+ struct A a;
+
+ /* Make sure we can't scalarize 'a'. */
+ baz (&a);
+
+ if (i > 10)
+ a.x = i;
+ else
+ a.x = i;
+
+ /* Copy propagation should prove that this predicate is always false. */
+ if (a.x != i)
+ link_error ();
+
+ return a.x;
+}
+
+main ()
+{
+ foo (30);
+ return 0;
+}
OpenPOWER on IntegriCloud