aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-12.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-12.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-12.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-12.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-12.c
new file mode 100644
index 00000000000..ab43eaf0a1a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-12.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev-details" } */
+
+
+int bar (void);
+
+int foo ()
+{
+ int a = -100;
+ int b = 2;
+ int c = 3;
+ int d = 4;
+
+ while (a)
+ {
+ a = a + b;
+
+ /* Exercises if-phi-nodes. */
+ if (bar ())
+ b = b + c;
+
+ c = c + d;
+ }
+}
+
+/* The analyzer has to detect the following evolution functions:
+ c -> {3, +, 4}_1
+ b -> {2, +, {[0, 3], +, [0, 4]}_1}_1
+ a -> {-100, +, {2, +, {[0, 3], +, [0, 4]}_1}_1}_1
+*/
+
+/* FIXME. */