]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Add testcase for already fixed PR [PR119226]
authorJakub Jelinek <jakub@redhat.com>
Wed, 12 Mar 2025 09:48:31 +0000 (10:48 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 12 Mar 2025 09:49:41 +0000 (10:49 +0100)
This was fixed in PR119219 r15-7981 commit.

2025-03-12  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/119226
* gcc.c-torture/compile/pr119226.c: New test.

gcc/testsuite/gcc.c-torture/compile/pr119226.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.c-torture/compile/pr119226.c b/gcc/testsuite/gcc.c-torture/compile/pr119226.c
new file mode 100644 (file)
index 0000000..8eb9857
--- /dev/null
@@ -0,0 +1,12 @@
+/* PR middle-end/119226 */
+
+char a[64];
+void bar (void);
+
+void
+foo (int x)
+{
+  char *b = a + __builtin_strcspn (a, x ? "" : "ab");
+  if (b[0])
+    bar ();
+}