PR middle-end/77674
[official-gcc.git] / gcc / testsuite / gfortran.dg / warn_conversion_3.f90
blobc50c03291664fde586be73128bf14069e0587bb0
1 ! { dg-do compile }
2 ! { dg-options "-Wconversion -Wconversion-extra" }
3 ! PR 47659 - warning about conversions on assignment
4 ! Based on a test case by Thomas Henlich
5 program main
6 double precision d1, d2
7 complex(8), parameter :: z = cmplx (0.5, 0.5) ! { dg-warning "Conversion" }
8 real :: r1, r2
9 r1 = 2.3d0 ! { dg-warning "Change of value in conversion" }
10 r2 = 2.5d0 ! { dg-warning "Conversion" }
11 d1 = .13 ! { dg-warning "Conversion" }
12 d2 = .13d0
13 d1 = z ! { dg-warning "Non-zero imaginary part" }
14 end program main