1 /* { dg-options "-O3" } */
3 /* N1150 5.3 Conversions between decimal floating and complex.
4 C99 6.3.1.7 Conversions, arithmetic operands, real and complex. */
13 _Complex
long double cld
;
19 cf
= 2.0f
* __extension__
1i
+ 3.0f
;
20 cd
= 2.0 * __extension__
1i
+ 3.0;
21 cld
= 2.0l * __extension__
1i
+ 3.0l;
23 /* Convert complex to decimal floating. */
35 /* Convert decimal floating to complex. */
44 /* N1107 5.3 Conversions between decimal floating and complex.
45 When a value of decimal floating type converted to a complex
46 type, the real part of the complex result value is undermined
47 by the rules of conversions in N1107 5.2 and the imaginary part
48 of the complex result value is zero. */
50 if (__real__ cf
!= 2.5f
)
52 if (__real__ cd
!=1.5)
54 if (__real__ cld
!= 2.5)
56 if (__imag__ cf
!= 0.0f
)
58 if (__imag__ cd
!= 0.0)
60 if (__imag__ cld
!= 0.0l)
63 /* Verify that the conversions from DFP types to complex is
64 determined by the rules of conversion to the real part. */
66 /* Convert _Decimal64 to _Complex float. */
69 if (__real__ cf
!= 0.125f
)
71 /* Convert _Decimal128 to _Complex double. */
74 if (__real__ cd
!= 1.25E-7)
77 /* Verify that conversion from complex to decimal floating types
78 results in the value of the real part converted to the result
79 type according to the rules of conversion between those types. */
81 /* Convert _Complex float to decimal float types. */
82 cf
= 2.0f
* __extension__
1i
+ 2.25f
;
93 /* Convert _Complex double to decimal float types. */
94 cd
= 2.0 * __extension__
1i
+ 1.25;
105 /* Convert _Complex long double to decimal float types. */
106 cld
= 2.0l * __extension__
1i
+ 0.0625l;
114 if (d128
!= 0.0625DL
)