OSDN Git Service

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