diff mbox

Add testcase for PR middle-end/68570

Message ID 20151202101606.GD3175@redhat.com
State New
Headers show

Commit Message

Marek Polacek Dec. 2, 2015, 10:16 a.m. UTC
This PR got fixed along with PR68625, so I'd like to add the testcase and close
the bug.

Tested on x86_64-linux, ok for trunk?

2015-12-02  Marek Polacek  <polacek@redhat.com>

	PR middle-end/68570
	* gcc.dg/torture/pr68570.c: New test.


	Marek

Comments

Jakub Jelinek Dec. 2, 2015, 10:20 a.m. UTC | #1
On Wed, Dec 02, 2015 at 11:16:06AM +0100, Marek Polacek wrote:
> This PR got fixed along with PR68625, so I'd like to add the testcase and close
> the bug.
> 
> Tested on x86_64-linux, ok for trunk?
> 
> 2015-12-02  Marek Polacek  <polacek@redhat.com>
> 
> 	PR middle-end/68570
> 	* gcc.dg/torture/pr68570.c: New test.

Ok.

	Jakub
diff mbox

Patch

diff --git gcc/testsuite/gcc.dg/torture/pr68570.c gcc/testsuite/gcc.dg/torture/pr68570.c
index e69de29..a8f2843 100644
--- gcc/testsuite/gcc.dg/torture/pr68570.c
+++ gcc/testsuite/gcc.dg/torture/pr68570.c
@@ -0,0 +1,35 @@ 
+/* PR middle-end/68570 */
+/* { dg-do compile } */
+
+int a, d, e, f, h, i, k;
+
+void
+fn1 ()
+{
+  char m;
+  for (;;)
+    {
+      for (;;)
+        {
+          e = f = 1;
+          if (i)
+            d = h = 0;
+          else
+            a = 0;
+          break;
+        }
+      k = 0;
+      if (f)
+        a = 3;
+      if (d)
+        f = 0;
+      if (a > (i < 1))
+        {
+          if (e)
+            break;
+        }
+      else
+        i = m;
+      k = i ? a : i;
+    }
+}