testsuite: Use noipa attribute for pr95115 test
authorXi Ruoyao <xry111@xry111.site>
Fri, 27 Jan 2023 11:03:05 +0000 (19:03 +0800)
committerXi Ruoyao <xry111@xry111.site>
Fri, 27 Jan 2023 12:04:25 +0000 (20:04 +0800)
This prevent the compiler from deeming the NaN result "unused" and
remove the calculation raising INVALID exception. See the discussion
in PR107608 for details.

gcc/testsuite/ChangeLog:

* gcc.dg/pr95115.c (x): Add noipa attribute.

gcc/testsuite/gcc.dg/pr95115.c

index 69c4f83..e7c3119 100644 (file)
@@ -6,7 +6,7 @@
 #include <fenv.h>
 #include <stdlib.h>
 
-double
+__attribute__ ((noipa)) double
 x (void)
 {
   double d = __builtin_inf ();