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

Message ID Zc4oJWYyQrCRE6m9@tucnak
State Accepted
Headers
Series [committed] testsuite: Add testcase for already fixed PR [PR107385] |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Jakub Jelinek Feb. 15, 2024, 3:05 p.m. UTC
  Hi!

This testcase has been fixed by the PR113921 fix, but unlike testcase
in there this one is not target specific.

Tested on x86_64-linux -m32/-m64, committed to trunk as obvious.

2024-02-15  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/107385
	* gcc.dg/pr107385.c: New test.


	Jakub
  

Patch

--- gcc/testsuite/gcc.dg/pr107385.c.jj	2024-01-13 00:05:00.077372302 +0100
+++ gcc/testsuite/gcc.dg/pr107385.c	2024-02-15 09:18:47.711260427 +0100
@@ -0,0 +1,20 @@ 
+/* PR middle-end/107385 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+__attribute__((noipa)) int
+foo (void)
+{
+  int x;
+  asm goto ("": "=r" (x) : "0" (15) :: lab);
+  x = 6;
+lab:
+  return x;
+}
+
+int
+main ()
+{
+  if (foo () != 6)
+    __builtin_abort ();
+}