diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1386babeda1..6a7ea862796 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2007-05-18 Andrew Pinski + + * gcc.dg/tree-ssa/forwprop-1.c: New testcase. + 2007-05-18 H.J. Lu 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 index 00000000000..ee7f049c664 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c @@ -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?" } } */ + +