Debian Codegraph @

gcc/testsuite/gcc.target/i386/excess-precision-9.c

raw
1 /* Excess precision tests. Test implicit conversions in comparisons:
2 no excess precision in C99 mode. */
3 /* { dg-do run } */
4 /* { dg-options "-std=c99 -mfpmath=387 -fexcess-precision=standard" } */
5
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9 extern void abort (void);
10 extern void exit (int);
11 #ifdef __cplusplus
12 }
13 #endif
14
15 int
16 main (void)
17 {
18 float f = 0x1p63f;
19 unsigned long long int u = (1ULL << 63) + 1;
20
21 if ((f == u) != 1)
22 abort ();
23
24 if ((u == f) != 1)
25 abort ();
26
27 if ((f != u) != 0)
28 abort ();
29
30 if ((u != f) != 0)
31 abort ();
32
33 if ((f < u) != 0)
34 abort ();
35
36 if ((u < f) != 0)
37 abort ();
38
39 if ((f <= u) != 1)
40 abort ();
41
42 if ((u <= f) != 1)
43 abort ();
44
45 if ((f > u) != 0)
46 abort ();
47
48 if ((u > f) != 0)
49 abort ();
50
51 if ((f >= u) != 1)
52 abort ();
53
54 if ((u >= f) != 1)
55 abort ();
56
57 exit (0);
58 }