]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add a test for PR tree-optimization/121656
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 25 Aug 2025 15:20:00 +0000 (08:20 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 25 Aug 2025 20:03:31 +0000 (13:03 -0700)
PR tree-optimization/121656
* gcc.dg/pr121656.c: New file.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
gcc/testsuite/gcc.dg/pr121656.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/pr121656.c b/gcc/testsuite/gcc.dg/pr121656.c
new file mode 100644 (file)
index 0000000..00b8941
--- /dev/null
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-options "-O1" } */
+
+__attribute__ ((weak))
+void
+foo (int b)
+{
+  if (b != 3)
+    __builtin_abort ();
+}
+
+int a;
+int
+main ()
+{
+  int b = 0;
+  if (a >= 0)
+    b += 3;
+  foo (b);
+  return 0;
+}