PR ipa/83051
[official-gcc.git] / gcc / testsuite / gfortran.dg / contiguous_5.f90
blob71d6d0374b56c3d324e4650db3bbbe5c115a08c3
1 ! { dg-do compile }
2 ! PR 83012 - this was incorrectly rejected.
3 ! Original test case by Neil Carlson.
4 module mod
5 type :: foo
6 integer, pointer, contiguous :: p(:)
7 contains
8 procedure :: dataptr
9 end type
10 contains
11 function dataptr(this) result(dp)
12 class(foo), intent(in) :: this
13 integer, pointer, contiguous :: dp(:)
14 dp => this%p
15 end function
16 end module
18 subroutine bar(x)
19 use mod
20 class(foo) :: x
21 integer, pointer, contiguous :: p(:)
22 p => x%dataptr()
23 end subroutine