OSDN Git Service

* gcc.dg/nodfp-1.c: New test.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / dfp / decfloat-constants.c
1 /* { dg-do compile } */
2 /* { dg-options "-std=gnu99" } */
3
4 /* N1150 4: Characteristics of decimal floating types <decfloat.h>.
5    C99 5.2.4.2.2a[3]: New.
6
7    Verify constants about range of decimal float and three components of
8    decimal float defined in decfloat.h.  */
9
10 /* Make sure we are exporting the right values to decfloat.h. */
11 #include <decfloat.h>
12
13 extern void abort (void);
14
15 int main ()
16 {
17   if (DEC32_MANT_DIG != 7) abort();
18   if (DEC64_MANT_DIG != 16) abort();
19   if (DEC128_MANT_DIG != 34) abort();
20
21   if (DEC32_MIN_EXP != -95) abort();
22   if (DEC64_MIN_EXP != -383) abort();
23   if (DEC128_MIN_EXP != -6143) abort();
24
25   if (DEC32_MAX_EXP != 96) abort();
26   if (DEC64_MAX_EXP != 384) abort();
27   if (DEC128_MAX_EXP != 6144) abort();
28
29   if (DEC32_MAX != 9.999999E96DF) abort();
30   if (DEC64_MAX != 9.999999999999999E384DD) abort();
31   if (DEC128_MAX != 9.999999999999999999999999999999999E6144DL) abort();
32
33   if (DEC32_EPSILON != 1E-6DF) abort();
34   if (DEC64_EPSILON != 1E-15DD) abort();
35   if (DEC128_EPSILON != 1E-33DL) abort();
36   
37   if (DEC32_MIN != 1E-95DF) abort();
38   if (DEC32_MIN != 1E-383DD) abort();
39   if (DEC128_MIN != 1E-6143DL) abort();
40
41   if (DEC32_DEN != 0.000001E-95DF) abort();
42   if (DEC64_DEN != 0.000000000000001E-383DD) abort();
43   if (DEC128_DEN != 0.000000000000000000000000000000001E-6143DL) abort();
44
45   return 0;
46 }