mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-18 18:46:40 +00:00

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.
11 lines
321 B
Fortran
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
|