Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.c-torture/execute/ieee/inf-1.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children | 1830386684a0 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 extern void abort (void); | |
2 | |
3 int main() | |
4 { | |
5 #ifndef __SPU__ | |
6 /* The SPU single-precision floating point format does not support Inf. */ | |
7 float fi = __builtin_inff(); | |
8 #endif | |
9 double di = __builtin_inf(); | |
10 long double li = __builtin_infl(); | |
11 | |
12 float fh = __builtin_huge_valf(); | |
13 double dh = __builtin_huge_val(); | |
14 long double lh = __builtin_huge_vall(); | |
15 | |
16 #ifndef __SPU__ | |
17 if (fi + fi != fi) | |
18 abort (); | |
19 #endif | |
20 if (di + di != di) | |
21 abort (); | |
22 if (li + li != li) | |
23 abort (); | |
24 | |
25 #ifndef __SPU__ | |
26 if (fi != fh) | |
27 abort (); | |
28 #endif | |
29 if (di != dh) | |
30 abort (); | |
31 if (li != lh) | |
32 abort (); | |
33 | |
34 #ifndef __SPU__ | |
35 if (fi <= 0) | |
36 abort (); | |
37 #endif | |
38 if (di <= 0) | |
39 abort (); | |
40 if (li <= 0) | |
41 abort (); | |
42 | |
43 return 0; | |
44 } |