aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/warn_conversion_3.f90
blob: 38d701851cc8d29c1a9bdf7b5cd5b93424f15764 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
! { dg-do compile }
! { dg-options "-Wconversion -Wconversion-extra" }
! PR 47659 - warning about conversions on assignment
! Based on a test case by Thomas Henlich
program main
  double precision d1, d2
  complex(8), parameter :: z = cmplx (0.5, 0.5)  ! { dg-warning "Conversion" }
  real :: r1, r2
  r1 = 2.3d0 ! { dg-warning "Change of value in conversion" }
  r2 = 2.5d0 ! No warning because the value does not change
  d1 = .13 ! { dg-warning "Conversion" }
  d2 = .13d0
  d1 = z     ! { dg-warning "change of value in conversion" }
end program main