c: Fix up pointer types to may_alias structures [PR114493]
[official-gcc.git] / gcc / testsuite / gfortran.dg / PR100097.f90
blobf927d293e2c32f3829a248e8b81f52784d3662e0
1 ! { dg-do run }
2 ! { dg-options "-fdump-tree-original" }
4 ! Test the fix for PR100097
7 program main_p
8 implicit none
10 class(*), pointer :: bar_p(:)
11 class(*), allocatable :: bar_a(:)
13 call foo_p(bar_p)
14 call foo_a(bar_a)
16 contains
18 subroutine foo_p(that)
19 class(*), pointer, intent(out) :: that(..)
21 select rank(that)
22 rank(1)
23 rank default
24 stop 1
25 end select
26 end subroutine foo_p
28 subroutine foo_a(that)
29 class(*), allocatable, intent(out) :: that(..)
31 select rank(that)
32 rank(1)
33 rank default
34 stop 2
35 end select
36 end subroutine foo_a
38 end program main_p
40 ! { dg-final { scan-tree-dump "bar_a._data.dtype = \\{.* .rank=1,.*\\}" "original" } }
41 ! { dg-final { scan-tree-dump "bar_p._data.dtype = \\{.* .rank=1,.*\\}" "original" } }