2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / class_array_4.f03
blob46b254db676ed7d0e66f4347e2b9fc582deefb25
1 ! { dg-do run }
2 ! PR43214 - implementation of class arrays
4 ! Contributed by Tobias Burnus  <burnus@gcc.gnu.org>
6 module m
7   type t
8     real :: r = 99
9   contains
10     procedure, pass :: foo => foo
11   end type t
12 contains
13   elemental subroutine foo(x, i)
14     class(t),intent(in) :: x
15     integer,intent(inout) :: i
16     i = x%r + i
17   end subroutine foo
18 end module m
20   use m
21   type(t) :: x(3)
22   integer :: n(3) = [0,100,200]
23   call x(:)%foo(n)
24   if (any(n .ne. [99,199,299])) call abort
25 end