aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr63514.f90
blob: 389fb92608ec2ec08af4421fb1247dfb16d143bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
! { dg-do compile }
! PR fortran/63514.f90
program foo

   implicit none

   integer, volatile :: n

   n = 0

   call bar
   call bah

   contains

   subroutine bar
      integer k
      integer, volatile :: m
      block
         integer, save :: i
         integer, volatile :: j
         i = 42
         j = 2 * i
         k = i + j + n
      end block
   end subroutine bar

   pure subroutine bah
      integer k
      integer, volatile :: m     ! { dg-error "cannot be specified in a PURE" }
      block
         integer, save :: i      ! { dg-error "cannot be specified in a PURE" }
         integer, volatile :: j  ! { dg-error "cannot be specified in a PURE" }
         i = 42                  ! { dg-error "has no IMPLICIT type" }
         j = 2 * i               ! { dg-error "has no IMPLICIT type" }
         k = i + j + n
      end block
      m = k * m                  ! { dg-error "has no IMPLICIT type" }
   end subroutine bah

end program foo