summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/saved_automatic_1.f90
blob: 53e7dce8305df4048db79c684142ab5d6e4ad4b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
! { dg-do compile }
! Tests patch for PR23091, in which autmatic objects caused
! an ICE if they were given the SAVE attribute.
!
! Contributed by Valera Veryazov  <valera.veryazov@teokem.lu.se>
!
Subroutine My(n1)
  integer :: myArray(n1)
  character(n1) :: ch
  save      ! OK because only allowed objects are saved globally.
  call xxx(myArray, ch)
  return
  end

Subroutine Thy(n1)
  integer, save :: myArray(n1) ! { dg-error "SAVE attribute" }
  character(n1), save :: ch ! { dg-error "SAVE attribute" }
  call xxx(myArray, ch)
  return
  end