llvm-project/flang/test/Lower/repack-arrays-asynchronous.f90
Slava Zakharin 2c91f10362
[flang] Fixed repacking for TARGET and INTENT(OUT) (#131972)
TARGET dummy arrays can be accessed indirectly, so it is unsafe
to repack them.
INTENT(OUT) dummy arrays that require finalization on entry
to their subroutine must be copied-in by `fir.pack_arrays`.

In addition, based on my testing results, I think it will be useful
to document that `LOC` and `IS_CONTIGUOUS` will have different values
for the repacked arrays. I still need to decide where to document
this, so just added a note in the design doc for the time being.
2025-03-19 17:12:32 -07:00

11 lines
321 B
Fortran

! RUN: bbc -emit-hlfir -frepack-arrays %s -o - | FileCheck --check-prefixes=CHECK %s
! Check that there is no repacking for ASYNCHRONOUS dummy argument.
! CHECK-LABEL: func.func @_QPtest(
! CHECK-NOT: fir.pack_array
! CHECK-NOT: fir.unpack_array
subroutine test(x)
integer, asynchronous :: x(:)
end subroutine test