summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/pr59014.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/pr59014.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr59014.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr59014.c b/gcc/testsuite/gcc.c-torture/execute/pr59014.c
new file mode 100644
index 00000000000..10bf81a462f
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr59014.c
@@ -0,0 +1,25 @@
+/* PR tree-optimization/59014 */
+
+int a = 2, b, c, d;
+
+int
+foo ()
+{
+ for (;; c++)
+ if ((b > 0) | (a & 1))
+ ;
+ else
+ {
+ d = a;
+ return 0;
+ }
+}
+
+int
+main ()
+{
+ foo ();
+ if (d != 2)
+ __builtin_abort ();
+ return 0;
+}