forwprop-1.c: New testcase.
authorAndrew Pinski <andrew_pinski@playstation.sony.com>
Fri, 18 May 2007 23:37:06 +0000 (23:37 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Fri, 18 May 2007 23:37:06 +0000 (16:37 -0700)
2007-05-18  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        * gcc.dg/tree-ssa/forwprop-1.c: New testcase.

From-SVN: r124840

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c [new file with mode: 0644]

index 1386bab..6a7ea86 100644 (file)
@@ -1,3 +1,7 @@
+2007-05-18  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+       * gcc.dg/tree-ssa/forwprop-1.c: New testcase.
+
 2007-05-18  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR target/31628
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c
new file mode 100644 (file)
index 0000000..ee7f049
--- /dev/null
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-forwprop" }  */
+
+/* We should be able to optimize this to b->t[i] = 1 during
+   early optimizations.  */
+
+struct a
+{
+  int t[10];
+};
+
+void f(struct a * b, __SIZE_TYPE__ i)
+{
+  int *c = b->t;
+  c[i] = 1;
+}
+
+/* { dg-final { scan-tree-dump "t\\\[i.*\\\] = 1;" "forwprop1" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump "t\\\[i.*\\\] = 1;" "forwprop2" } } */
+/* { dg-final { cleanup-tree-dump "forwprop?" } } */
+
+