summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr47899.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr47899.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr47899.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr47899.c b/gcc/testsuite/gcc.dg/pr47899.c
new file mode 100644
index 000000000..c83bb85e3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr47899.c
@@ -0,0 +1,26 @@
+/* PR rtl-optimization/47899 */
+/* { dg-do compile } */
+/* { dg-options "-O -funroll-loops" } */
+
+extern unsigned int a, b, c;
+extern int d;
+
+static int
+foo (void)
+{
+lab:
+ if (b)
+ for (d = 0; d >= 0; d--)
+ if (a || c)
+ for (; c; c++)
+ ;
+ else
+ goto lab;
+}
+
+int
+main ()
+{
+ foo ();
+ return 0;
+}