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