aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-18.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-18.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-18.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-18.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-18.c
new file mode 100644
index 00000000000..73996eac447
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-18.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev-details" } */
+
+
+int bar (void);
+
+int foo (int x)
+{
+ int a = -100;
+ int b = 2;
+
+ while (b)
+ {
+ if (x)
+ a += 3;
+ else
+ a += bar ();
+
+ /* Exercises the case when one of the branches of the if-phi-node cannot
+ be determined: [-oo, +oo].
+ Since the evolution function is too difficult to handle in the expanded
+ form, we have to keep it in its symbolic form: "b -> {2, +, a_1}_1". */
+ b += a;
+ }
+}
+
+/* a -> {-100, +, [min<t, 3>, max<t, 3>]}_1
+ b -> {2, +, {[min<t, 3>, max<t, 3>] - 100, +, [min<t, 3>, max<t, 3>]}_1}_1
+*/
+
+/* FIXME. */