OSDN Git Service

PR middle-end/19984
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / dfp / convert-bfp-2.c
1 /* { dg-options "-std=gnu99" } */
2
3 /* This test assumes IEEE float and double.  It also tests long double
4    but makes no assumption about its size or range of values.  */
5
6 #include "convert.h"
7
8 volatile _Decimal32 sd;
9 volatile _Decimal64 dd;
10 volatile _Decimal128 td;
11 volatile float sf;
12 volatile double df;
13 volatile long double tf;   /* might actually be df or xf, doesn't matter */
14
15 CONVERT_VALID_ALL (t1, 0.0, 0.)
16 CONVERT_VALID_ALL (t2, 1.0, 0.)
17 CONVERT_VALID_ALL (t3, -11.5, 0.)
18 CONVERT_VALID_ALL (t4, 7.0, 0.1e-14)
19 CONVERT_VALID_ALL (t5, -7.0, 0.1e-14)
20 CONVERT_VALID_ALL (t6, 999999., 0.)
21 CONVERT_VALID_ALL (t7, -999999., 0.)
22
23 int
24 main ()
25 {
26   CALL_VALID_ALL (t1)
27   CALL_VALID_ALL (t2)
28   CALL_VALID_ALL (t3)
29   CALL_VALID_ALL (t4)
30   CALL_VALID_ALL (t5)
31   CALL_VALID_ALL (t6)
32   CALL_VALID_ALL (t7)
33
34   if (failcnt != 0)
35     abort ();
36   return 0;
37 }