* gcc.dg/torture/stackalign/builtin-apply-2.c: Fix skip-if syntax.
[official-gcc.git] / gcc / testsuite / gcc.dg / pr61441.c
blob1b0f1810d8a1cdc12e6794bb4251c0101b6c7197
1 /* { dg-do run { target { *-*-linux* *-*-gnu* } } } */
2 /* { dg-options "-O1 -lm -fexcess-precision=standard" } */
3 /* { dg-require-effective-target issignaling } */
5 #define _GNU_SOURCE
6 #include <stdio.h>
7 #include <math.h>
9 void conversion()
11 float sNaN = __builtin_nansf ("");
12 double x = (double) sNaN;
13 if (issignaling(x))
15 __builtin_abort();
19 enum op {Add, Mult, Div, Abs};
21 void operation(enum op t)
23 float x, y;
24 float sNaN = __builtin_nansf ("");
25 switch (t)
27 case Abs:
28 x = fabs(sNaN);
29 break;
30 case Add:
31 x = sNaN + 2.0;
32 break;
33 case Mult:
34 x = sNaN * 2.0;
35 break;
36 case Div:
37 default:
38 x = sNaN / 2.0;
39 break;
41 if (t == Abs)
43 if (!issignaling(x))
45 __builtin_abort();
48 else if (issignaling(x))
50 __builtin_abort();
54 int main (void)
56 conversion();
57 operation(Add);
58 operation(Mult);
59 operation(Div);
60 #if __FLT_EVAL_METHOD__ == 0
61 operation(Abs);
62 #endif
63 return 0;