2 ! { dg-additional-options "-fdump-tree-original" }
4 ! Test the fix for PR93963
9 function rank_p(this
) result(rnk
) bind(c
)
10 use, intrinsic :: iso_c_binding
, only
: c_int
14 integer(kind
=c_int
), pointer, intent(in
) :: this(..)
15 integer(kind
=c_int
) :: rnk
56 function rank_a(this
) result(rnk
) bind(c
)
57 use, intrinsic :: iso_c_binding
, only
: c_int
61 integer(kind
=c_int
), allocatable
, intent(in
) :: this(..)
62 integer(kind
=c_int
) :: rnk
103 function rank_o(this
) result(rnk
) bind(c
)
104 use, intrinsic :: iso_c_binding
, only
: c_int
108 integer(kind
=c_int
), intent(in
) :: this(..)
109 integer(kind
=c_int
) :: rnk
154 use, intrinsic :: iso_c_binding
, only
: c_int
158 integer(kind
=c_int
), parameter :: siz
= 7
159 integer(kind
=c_int
), parameter :: rnk
= 1
161 integer(kind
=c_int
), pointer :: intp(:)
162 integer(kind
=c_int
), allocatable
:: inta(:)
163 integer(kind
=c_int
) :: irnk
167 if (irnk
/= rnk
) stop 1
168 if (irnk
/= rank(intp
)) stop 2
171 if (irnk
/= rnk
) stop 3
172 if (irnk
/= rank(inta
)) stop 4
176 if (irnk
/= rnk
) stop 5
177 if (irnk
/= rank(intp
)) stop 6
179 if (irnk
/= rnk
) stop 7
180 if (irnk
/= rank(intp
)) stop 8
186 if (irnk
/= rnk
) stop 9
187 if (irnk
/= rank(inta
)) stop 10
189 if (irnk
/= rnk
) stop 11
190 if (irnk
/= rank(inta
)) stop 12
195 ! Special code for assumed rank - but only if not allocatable/pointer
196 ! Thus, expect it only once for subroutine rank_o but not for rank_a or rank_p
197 ! { dg-final { scan-tree-dump-times "ubound != -1" 1 "original" } }