aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/no-automatic.f90
blob: 42baf4d2e0c0c8a3b4f2e307ab7b6c2656fd9dd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
! { dg-do run }
! { dg-options "-fno-automatic" }
!
! PR fortran/37835
! Contributed by Tobias Burnus <burnus@gcc.gnu.org>.
!
subroutine foo(n)
  integer :: n
  type t
    integer :: i = 42
  end type t
  type(t) :: myt
  if(n==1) myt%i = 2
  print *, myt%i
  if (n > 1 .and. myt%i /= 2) stop 1
end subroutine foo

call foo(1)
call foo(2)
end