Ticket #18656: foo.c
File foo.c, 406 bytes (added by , 13 months ago) |
---|
Line | |
---|---|
1 | #include <fenv.h> |
2 | #include <stdio.h> |
3 | |
4 | static double zero; |
5 | static double volatile qnand; |
6 | int volatile c; |
7 | |
8 | static void |
9 | raise_invalid_comparison () |
10 | { |
11 | double volatile a, b; |
12 | a = qnand; b = qnand; |
13 | c = a > b; |
14 | } |
15 | |
16 | int |
17 | main (int argc, char *argv[]) |
18 | { |
19 | qnand = zero / zero; |
20 | feclearexcept (FE_ALL_EXCEPT); |
21 | if (feenableexcept (FE_ALL_EXCEPT) == -1) |
22 | return 2; |
23 | raise_invalid_comparison (); |
24 | return 0; |
25 | } |