Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/c-c++-common/dfp/loop-index.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* C99 6.8.5.2: The for statement. */ | |
2 | |
3 #include <stdio.h> | |
4 #include <stdlib.h> | |
5 #include "dfp-dbg.h" | |
6 | |
7 void | |
8 f32 (void) | |
9 { | |
10 _Decimal32 d; | |
11 int i; | |
12 | |
13 for (d = 1.1df, i=0; d <= 1.5df; d += 0.1df) | |
14 i++; | |
15 | |
16 if (i != 5) | |
17 FAILURE | |
18 } | |
19 | |
20 void | |
21 f64 (void) | |
22 { | |
23 _Decimal64 d; | |
24 int i; | |
25 | |
26 for (d = 1.1dd, i=0; d <= 1.5dd; d += 0.1dd) | |
27 i++; | |
28 | |
29 if (i != 5) | |
30 FAILURE | |
31 } | |
32 | |
33 void | |
34 f128 (void) | |
35 { | |
36 _Decimal128 d; | |
37 int i; | |
38 | |
39 for (d = 1.1dl, i=0; d <= 1.5dl; d += 0.1dl) | |
40 i++; | |
41 | |
42 if (i != 5) | |
43 FAILURE | |
44 } | |
45 | |
46 int | |
47 main () | |
48 { | |
49 int i; | |
50 | |
51 f32 (); | |
52 f64 (); | |
53 f128 (); | |
54 | |
55 FINISH | |
56 return (0); | |
57 } |