]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/125153 - testcase for fixed PR
authorRichard Biener <rguenther@suse.de>
Mon, 4 May 2026 12:13:30 +0000 (14:13 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 4 May 2026 12:14:44 +0000 (14:14 +0200)
The following adds a testcase for the PR which was fixed by
reversion of r16-303.

PR tree-optimization/125153
* gcc.dg/torture/pr125153.c: New testcase.

gcc/testsuite/gcc.dg/torture/pr125153.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/torture/pr125153.c b/gcc/testsuite/gcc.dg/torture/pr125153.c
new file mode 100644 (file)
index 0000000..484dc18
--- /dev/null
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+
+int a, b, c;
+_Bool d, e;
+
+void
+foo (void)
+{
+  if (d)
+    {
+    l: b = -1;
+    }
+  e = c <= b;
+  a = a - 7;
+  if (e)
+    goto l;
+}
+
+int
+main ()
+{
+  foo ();
+  if (a != -14)
+    __builtin_abort ();
+}