[committed] testsuite: Add testcase for already fixed PR [PR119226]

Message ID Z9FZB2CC4yijL/oV@tucnak
State New
Headers
Series [committed] testsuite: Add testcase for already fixed PR [PR119226] |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_simplebootstrap_build--master-aarch64-bootstrap success Build passed
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_simplebootstrap_build--master-arm-bootstrap success Build passed

Commit Message

Jakub Jelinek March 12, 2025, 9:51 a.m. UTC
  Hi!

On Wed, Mar 12, 2025 at 08:31:27AM +0100, Jakub Jelinek wrote:
> On Wed, Mar 12, 2025 at 12:04:52AM -0700, Andrew Pinski wrote:
> > I think it would be useful to add the C testcase that fails during DOM
> > from PR 119226 since that is another path to get the ICE.
> 
> I've committed the patch already.
> Feel free to commit the testcase for it (preferably a little bit cleaned
> up, replacing the fancy identifiers in the test with something short and
> __SIZE_TYPE__ as return type from strcspn prototype).

I went ahead and committed this as obvious:

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

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



	Jakub
  

Patch

--- gcc/testsuite/gcc.c-torture/compile/pr119226.c.jj	2025-03-12 10:32:12.600079450 +0100
+++ gcc/testsuite/gcc.c-torture/compile/pr119226.c	2025-03-12 10:31:51.832364744 +0100
@@ -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 ();
+}