Ticket #18656: foo.c

File foo.c, 406 bytes (added by bhaible, 13 months ago)

test case foo.c

Line 
1#include <fenv.h>
2#include <stdio.h>
3
4static double zero;
5static double volatile qnand;
6int volatile c;
7
8static void
9raise_invalid_comparison ()
10{
11 double volatile a, b;
12 a = qnand; b = qnand;
13 c = a > b;
14}
15
16int
17main (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}