summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr103389.f90
blob: 565551564e395be3eb010ab99bfa54d40ae4b633 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
! { dg-do run }
!
! Contributed by Gerhard Steinmetz  <gscfq@t-online.de>
!
program p
   type t
      integer, allocatable :: a(:)
   end type
   type(t) :: y
   y%a = [1,2]
   call s((y))
   if (any (y%a .ne. [3,4])) stop 1
contains
   subroutine s(x)
      class(*) :: x
      select type (x)
        type is (t)
          x%a = x%a + 2
        class default
          stop 2
      end select
   end
end