Add _FloatN, _FloatNx tests for __builtin_fpclassify.
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / ftrapv-1.c
blob66fa33f1568563c053ec7204b59537c810b468ce
1 /* { dg-do run } */
2 /* { dg-additional-options "-ftrapv -fno-ipa-vrp" } */
3 /* { dg-require-effective-target trapping } */
4 /* { dg-require-fork "" } */
6 #include <stdlib.h>
7 #include <unistd.h>
8 #include <sys/types.h>
9 #include <sys/wait.h>
11 /* Verify SImode operations properly trap. PR middle-end/52478 */
13 /* Disallow inlining/cloning which would constant propagate and trigger
14 unrelated bugs. */
16 int __attribute__((noinline,noclone))
17 iaddv (int a, int b)
19 return a + b;
22 int main(void)
24 pid_t child = fork ();
25 int status = 0;
26 if (child == 0)
28 volatile int x = iaddv (__INT_MAX__, 1);
29 exit (0);
31 else if (child == -1)
32 return 0;
33 if (wait (&status) == child
34 && status == 0)
35 abort ();
36 return 0;