summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/loop-39.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/loop-39.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/loop-39.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-39.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-39.c
new file mode 100644
index 00000000000..1f6bba42fd4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-39.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-sccp-details" } */
+
+int
+foo (unsigned int n)
+{
+ int i, r = 1;
+ if (n > 0)
+ {
+ asm ("");
+ if (n < 10)
+ {
+ asm ("");
+ do
+ {
+ --n;
+ r *= 2;
+ }
+ while (n > 0);
+ }
+ }
+ return r + n;
+}
+
+/* { dg-final { scan-tree-dump "# of iterations \[^\n\r]*, bounded by 8" "sccp" } } */
+/* { dg-final { cleanup-tree-dump "sccp" } } */