Skip to content

Commit 1e69803

Browse files
New test to check for copy-in/out for potential slicing test
1 parent d60edf8 commit 1e69803

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

flang/test/Lower/force-temp.f90

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,32 @@ subroutine s6(b)
9494
type(base), intent(inout) :: b(:)
9595
end subroutine s6
9696
end interface
97+
class(base), pointer :: pb(:)
98+
type(child), target :: c(2)
9799
!CHECK-LABEL: func.func @_QMtestPcall_s6
98100
!CHECK-NOT: hlfir.copy_in
99101
!CHECK: fir.call @_QPs6
100102
!CHECK-NOT: hlfir.copy_out
101-
class(base), pointer :: pb(:)
102-
type(child), target :: c(2)
103-
104-
c = (/(child (i, real(i*2)), i=1,size(c))/)
105103
pb => c
106104
call s6(pb)
107105
end subroutine call_s6
106+
subroutine call_s7()
107+
interface
108+
subroutine s7(b1, b2, n)
109+
import :: base
110+
integer :: n
111+
type(base), intent(inout) :: b1(n)
112+
type(base), intent(inout) :: b2(*)
113+
end subroutine
114+
end interface
115+
integer, parameter :: n = 7
116+
class(base), allocatable :: c1(:), c2(:)
117+
!CHECK-LABEL: func.func @_QMtestPcall_s7
118+
!CHECK: hlfir.copy_in
119+
!CHECK: hlfir.copy_in
120+
!CHECK: fir.call @_QPs7
121+
!CHECK: hlfir.copy_out
122+
!CHECK: hlfir.copy_out
123+
call s7(c1, c2, n)
124+
end subroutine call_s7
108125
end module

0 commit comments

Comments
 (0)