1 /* { dg-options "-O0 -w" } */
3 /* N1150 5.1 Conversions from decimal float to integer. */
5 /* Test decimal float to integer conversions for values at the limit of
6 what will fit into the destination type. This assumes 32-bit int and
7 64-bit long long (there's a check for that below). */
11 volatile _Decimal32 d32
;
12 volatile _Decimal64 d64
;
13 volatile _Decimal128 d128
;
15 volatile unsigned int ui
;
16 volatile long long sll
;
17 volatile unsigned long long ull
;
22 /* _Decimal32 to int. */
31 if (si
!= -2147483000)
34 /* _Decimal32 to unsigned int. */
38 if (ui
!= 4294967000U)
41 /* _Decimal32 to long long. */
45 if (sll
!= 9223372000000000000LL)
50 if (sll
!= -9223372000000000000LL)
53 /* _Decimal32 to unsigned long long. */
57 if (ull
!= 18446740000000000000ULL)
60 /* _Decimal64 to int. */
62 d64
= 2.147483647E9DD
;
69 if (si
!= -2147483648)
72 /* _Decimal64 to unsigned int. */
74 d64
= 42949.67295E5DD
;
79 /* _Decimal64 to long long. */
81 d64
= 9.223372036854775E18DD
;
83 if (sll
!= 9223372036854775000LL)
86 d64
= -92233720.36854775E11DD
;
88 if (sll
!= -9223372036854775000LL)
91 /* _Decimal64 to unsigned long long. */
92 d64
= 1844674407370955.E4DD
;
94 if (ull
!= 18446744073709550000ULL)
97 /* _Decimal128 to int. */
99 d128
= 2.147483647E9DL
;
101 if (si
!= 2147483647)
104 d128
= -2147483648.DL
;
106 if (si
!= -2147483648)
109 /* _Decimal128 to unsigned int. */
111 d128
= 4294.967295E6DL
;
113 if (ui
!= 4294967295)
116 /* _Decimal128 to long long. */
118 d128
= 9223372036854775807.DL
;
120 if (sll
!= 9223372036854775807LL)
123 d128
= -9.223372036854775808E19DL
;
125 if (sll
!= -9223372036854775807LL - 1LL)
128 /* _Decimal128 to unsigned long long. */
129 d128
= 18446744073709551615.DL
;
131 if (ull
!= 18446744073709551615ULL)
138 /* This test assumes 32-bit int and 64-bit long long. */
140 if (sizeof (int) != 4 || sizeof (long long) != 8)