2 ! { dg-options "-Wconversion" }
3 ! PR 47359 - additional warnings for conversions.
10 complex(kind
=4), parameter :: c4p
= (1.0, -4.)
11 complex, parameter :: c8w
= (1.0_8
, -4.2_8
) ! { dg-warning "Change of value in conversion" }
12 complex (kind
=8), parameter :: c8p
= (1.0_8
, -4.2_8
)
15 c4
= c8p
! { dg-warning "Change of value in conversion" }
16 c4
= 2**26 + 1 ! { dg-warning "Change of value in conversion" }
17 c4
= 1.3d0 ! { dg-warning "Change of value in conversion" }
18 c4
= c8p
! { dg-warning "Change of value in conversion" }
19 c4
= (1.2, 1000000001) ! { dg-warning "Change of value in conversion" }
20 r4
= (2**26 + 1) * 2.3 ! { dg-warning "Change of value in conversion" }
21 r4
= 2.4d0 ! { dg-warning "Change of value" }
22 r4
= c4p
! { dg-warning "Non-zero imaginary part" }
23 r4
= r4
+ 2.3d0 ! { dg-warning "Possible change of value in conversion" }
24 r8
= 2_8**62 - 1_8 ! { dg-warning "Change of value in conversion" }
25 i
= c4p
! { dg-warning "Non-zero imaginary part" }
26 i
= 42 + 1.3 ! { dg-warning "Change of value in conversion" }
27 i
= (1.2, 0.) ! { dg-warning "Change of value in conversion" }
29 c4
= -3.25d0 ! no warning
31 c8
= 2**26 + 1 ! no warning
33 i
= (35., 0.) ! no warning
34 r4
= 2.5d0 ! no warning