diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c new file mode 100644 index 00000000000..95aa77eb3f7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.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 +{ + char t[10]; +}; + +struct a *b; + +void f(__SIZE_TYPE__ i) +{ + char *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?" } } */ |