Issue |
147819
|
Summary |
Support LOWER optional argument in C_F_POINTER interface
|
Labels |
new issue
|
Assignees |
|
Reporter |
bcornille
|
Fortran 2023 introduced the LOWER optional argument to C_F_POINTER. It would be useful for this to be supported in flang.
Example:
```
program CPointersLB
use iso_c_binding
implicit none
real, allocatable, target :: A(:,:,:)
type(c_ptr) :: ptr
integer :: nx, ny, nz, i
real, pointer :: chunk(:,:)
nx = 10
ny = 10
nz = 10
allocate(A(nx, ny, nz))
A = reshape([(real(i), i=1, nx*ny*nz)], shape(A))
ptr = c_loc(A(1,1,1))
call c_f_pointer(ptr, chunk, [nx, ny], [0, 0])
print *, chunk(0,1)
deallocate(A)
end program
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs