aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-10.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-10.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-10.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-10.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-10.c
new file mode 100644
index 00000000000..649dfb0b2d8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-10.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev -fall-data-deps -fdump-tree-ddall" } */
+
+void bar (int);
+
+int foo (void)
+{
+ int a;
+ int x;
+ int c[100][100];
+
+ /* loop_1 runs 39 times. */
+ for (a = 11; a < 50; a++)
+ {
+ /* Array access functions have to be analyzed. */
+ x = a + 5;
+ c[x][a+1] = c[x+2][a+3] + c[x-1][a+2];
+ }
+ bar (c[1][2]);
+}
+
+/* The analyzer has to detect the scalar functions:
+ a -> {11, +, 1}_1
+ x -> {16, +, 1}_1
+ x+2 -> {18, +, 1}_1
+ x-1 -> {15, +, 1}_1
+*/
+
+/* { dg-final { scan-tree-dump-times "nb_iterations 39" 1 "scev"} } */
+/* { dg-final { diff-tree-dumps "ddall" } } */