2014-07-12 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / initialization_16.f90
bloba717eeefcb735ac54497cf24f48b3a018200b629
1 ! { dg-do compile }
2 ! { dg-options "-std=f95 -Wall" }
4 ! PR fortran/34495
6 ! Check for invalid Fortran 95 initialization expressions
8 program main
9 implicit none
10 real, parameter :: r1 = real(33) ! { dg-error "Fortran 2003: Function 'real' as initialization expression" }
11 real, parameter :: r2 = dble(33) ! { dg-error "Fortran 2003: Function 'dble' as initialization expression" }
12 complex, parameter :: z = cmplx(33,33)! { dg-error "Fortran 2003: Function 'cmplx' as initialization expression" }
13 real, parameter :: r4 = sngl(3.d0) ! { dg-error "Fortran 2003: Function 'sngl' as initialization expression" }
14 real, parameter :: r5 = float(33) ! { dg-error "Fortran 2003: Function 'float' as initialization expression" }
15 end program main