diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-39.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-39.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-39.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-39.c new file mode 100644 index 00000000000..8e1857277c1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-39.c @@ -0,0 +1,45 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev-details" } */ + + +int foo (int ParmN) +{ + int a = 3; + int b = 2; + int d = -5; + + while (a) + { + b += 25; + a += b; + + for (d = -5; d < 0; d++) + { + /* Exercises the build_polynomial_evolution_in_loop in the following context: + (add_to_evolution + loop_num = 2 + chrec_before = {3, +, {27, +, 25}_1}_1 + to_add = ParmN_15 + res = {{3, +, {27, +, 25}_1}_1, +, ParmN_15}_2 + ) + + Then it exercises the add_expr_to_loop_evolution in the following context: + (add_to_evolution + loop_num = 1 + chrec_before = {{3, +, {27, +, 25}_1}_1, +, ParmN_15}_2 + to_add = ParmN_15 * 5 + res = {{3, +, {ParmN_15 * 5 + 27, +, 25}_1}_1, +, ParmN_15}_2 + ) + */ + a += ParmN; + } + } +} + +/* + b -> {2, +, 25}_1 + d -> {-5, +, 1}_2 + a -> {{3, +, {ParmN * 5 + 27, +, 25}_1}_1, +, ParmN}_2 +*/ + +/* FIXME. */ |