aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr57521.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr57521.c')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr57521.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr57521.c b/gcc/testsuite/gcc.dg/torture/pr57521.c
new file mode 100644
index 00000000000..e7832cb00e8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr57521.c
@@ -0,0 +1,51 @@
+/* { dg-do run } */
+/* { dg-options "-ftree-loop-if-convert" } */
+
+void abort (void);
+
+int a, b, c, d, o = 1, p;
+short e;
+
+int
+fn1 (int * p1)
+{
+ int f, g, h, j = 0, k = 0, l = 0;
+ unsigned int i;
+ int *m[1] = { &l };
+ for (; b >= 0; b--)
+ {
+ if (*p1)
+ if (j >= 0)
+ {
+ int n = 1;
+ e = 1;
+ h = a ? a : 1 % n;
+ g = h > 0 ? 0 : h + 1;
+ k = c + g;
+ }
+ else
+ continue;
+ else
+ {
+
+ f = d > 0 ? 0 : d + 1;
+ i = f;
+ j = 1 + i;
+ }
+ l++;
+ }
+ return k;
+}
+
+int
+main ()
+{
+ for (;; p++)
+ {
+ fn1 (&o);
+ break;
+ }
+ if (e != 1)
+ abort ();
+ return 0;
+}