aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/used_before_typed_2.f90
blob: 6f3031fcd7dee53bc8ed0dad0c50d0c4ed4a728f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
! { dg-do compile }
! { dg-options "-std=gnu" }

! PR fortran/32095
! PR fortran/34228
! This program used to segfault, check this is fixed.
! Also check that -std=gnu behaves as expected.

SUBROUTINE test1 (n, arr)
  IMPLICIT NONE

  INTEGER :: arr(n) ! { dg-bogus "used before it is typed" }
  INTEGER :: n
  CHARACTER(len=LEN(a)) :: a ! { dg-error "used before it is typed" }
END SUBROUTINE test1

SUBROUTINE test2 ()
  IMPLICIT NONE

  DATA str/'abc'/ ! { dg-bogus "used before it is typed" }
  CHARACTER(len=3) :: str
END SUBROUTINE test2