diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-05.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-05.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-05.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-05.c new file mode 100644 index 00000000000..cb02875e674 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-05.c @@ -0,0 +1,32 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev-details" } */ + + +int main(void) +{ + int a; + int b; + int c; + + /* nb_iterations 28 */ + for (a = 22; a < 50; a++) + { + /* nb_iterations 6 */ + for (b = 23; b < 50; b+=5) + { + /* nb_iterations {78, +, -1}_1 */ + for (c = a; c < 100; c++) + { + + } + } + } +} + +/* The analyzer has to detect the following evolution functions: + a -> {22, +, 1}_1 + b -> {23, +, 5}_2 + c -> {{22, +, 1}_1, +, 1}_3 +*/ +/* { dg-final { scan-tree-dump-times "nb_iterations 28" 1 "scev"} } */ +/* { dg-final { scan-tree-dump-times "nb_iterations 6" 1 "scev"} } */ |