]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: add testcase for fixed PR115933
authorSam James <sam@gentoo.org>
Sun, 20 Oct 2024 07:28:59 +0000 (08:28 +0100)
committerSam James <sam@gentoo.org>
Fri, 25 Oct 2024 16:57:55 +0000 (17:57 +0100)
gcc/testsuite/ChangeLog:
PR rtl-optimization/115933

* gcc.dg/pr115933.c: New test.

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

diff --git a/gcc/testsuite/gcc.dg/pr115933.c b/gcc/testsuite/gcc.dg/pr115933.c
new file mode 100644 (file)
index 0000000..041597a
--- /dev/null
@@ -0,0 +1,19 @@
+/* PR rtl-optimization/115933 */
+/* { dg-do run } */
+/* { dg-options "-O1 -fno-tree-loop-optimize -ftree-vrp -fno-tree-ch -fgcse" } */
+
+int a, b;
+unsigned c() {
+  int d, e = d = 2;
+  if (a < 0)
+    for (e = 0; e < 1; e++)
+      d = 0;
+  b = e;
+  return d;
+}
+int main() {
+  c();
+  if (b != 2)
+    __builtin_abort();
+  return 0;
+}