Document gcov-io (PR gcov-profile/84735).
[official-gcc.git] / gcc / testsuite / gcc.dg / pr61441.c
blobaaa259130a720d953db6cdf461e6e0d956ceab76
1 /* { dg-do run { target { *-*-linux* *-*-gnu* } } } */
2 /* { dg-options "-O1 -lm -fexcess-precision=standard -fsignaling-nans" } */
3 /* { dg-add-options ieee } */
4 /* { dg-require-effective-target issignaling } */
6 #define _GNU_SOURCE
7 #include <stdio.h>
8 #include <math.h>
10 void conversion()
12 float sNaN = __builtin_nansf ("");
13 double x = (double) sNaN;
14 if (issignaling(x))
16 __builtin_abort();
20 enum op {Add, Mult, Div, Abs};
22 void operation(enum op t)
24 float x, y;
25 float sNaN = __builtin_nansf ("");
26 switch (t)
28 case Abs:
29 x = fabs(sNaN);
30 break;
31 case Add:
32 x = sNaN + 2.0;
33 break;
34 case Mult:
35 x = sNaN * 2.0;
36 break;
37 case Div:
38 default:
39 x = sNaN / 2.0;
40 break;
42 if (t == Abs)
44 if (!issignaling(x))
46 __builtin_abort();
49 else if (issignaling(x))
51 __builtin_abort();
55 int main (void)
57 conversion();
58 operation(Add);
59 operation(Mult);
60 operation(Div);
61 #if __FLT_EVAL_METHOD__ == 0
62 operation(Abs);
63 #endif
64 return 0;