diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/loop-14.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/loop-14.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-14.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-14.c new file mode 100644 index 00000000000..ff96e128beb --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-14.c @@ -0,0 +1,19 @@ +/* A test for final value replacement. */ + +/* { dg-options "-O2 -fdump-tree-vars" } */ + +int foo(void); + +int bla(void) +{ + int i, j = foo (); + + for (i = 0; i < 100; i++, j++) + foo (); + + /* Should be replaced with return j0 + 100; */ + return j; +} + +/* { dg-final { scan-tree-dump-times "\\+ 100" 1 "vars" } } */ +/* { dg-final { cleanup-tree-dump "vars" } } */ |