OSDN Git Service

PR debug/43983
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / used_before_typed_2.f90
1 ! { dg-do compile }
2 ! { dg-options "-std=gnu" }
3
4 ! PR fortran/32095
5 ! PR fortran/34228
6 ! This program used to segfault, check this is fixed.
7 ! Also check that -std=gnu behaves as expected.
8
9 SUBROUTINE test1 (n, arr)
10   IMPLICIT NONE
11
12   INTEGER :: arr(n) ! { dg-bogus "used before it is typed" }
13   INTEGER :: n
14   CHARACTER(len=LEN(a)) :: a ! { dg-error "used before it is typed" }
15 END SUBROUTINE test1
16
17 SUBROUTINE test2 ()
18   IMPLICIT NONE
19
20   DATA str/'abc'/ ! { dg-bogus "used before it is typed" }
21   CHARACTER(len=3) :: str
22 END SUBROUTINE test2