1! { dg-do compile }
2! PR fortran/60126 - ICE on pointer rank remapping
3! Based on testcase by Michel Valin <mfvalin at gmail dot com>
4
5subroutine simple_bug_demo
6  implicit none
7  interface
8     function offset_ptr_R4(nelements) result (dest)
9       implicit none
10       real, pointer, dimension(:) :: dest
11       integer, intent(IN) :: nelements
12     end function offset_ptr_R4
13  end interface
14
15  real, dimension(:,:), pointer :: R2D
16
17  R2D(-2:2,-3:3) => offset_ptr_R4(100)
18end
19