You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
program main
double precision, target :: tar2(100)
double precision, pointer :: ptr(:,:,:)
i = -2
call sub (i)
contains
function set_bd(i)
integer i, set_bd
allocatable set_bd
allocate(set_bd, source = i)
end function
subroutine sub(i)
integer i
ptr(i:i-1, 1:set_bd(0), int(3.2):i) => tar2
print*, lbound(ptr)
print*, ubound(ptr)
end subroutine
End program
Flang outpus
> a.out
1 1 3
0 0 -2
The expected output should be
> a.out
1 1 1
0 0 0
All ifort, gfortran and XLF produces the correct result.