File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ subroutine pass_ignore_tkr_c_2(buf)
2222 ! DIR$ IGNORE_TKR (tkrcdm) buf
2323 type (* ) :: buf
2424 end subroutine
25+ subroutine pass_intent_out (buf )
26+ implicit none
27+ integer , intent (out ) :: buf(5 )
28+ end subroutine
2529 end interface
2630contains
2731 subroutine s1 (buf )
@@ -60,4 +64,19 @@ subroutine s4(buf)
6064 ! Don't create temp here
6165 call pass_ignore_tkr_c_2(buf)
6266 end subroutine
67+ subroutine s5 ()
68+ ! TODO: pass_intent_out() has intent(out) dummy argument, so as such it
69+ ! should have copy-out, but not copy-in. Unfortunately, at the moment flang
70+ ! can only do copy-in/copy-out together. When this is fixed, this test should
71+ ! change from 'CHECK' for hlfir.copy_in to 'CHECK-NOT' for hlfir.copy_in
72+ ! CHECK-LABEL: func.func @_QMtestPs5
73+ ! CHECK: hlfir.copy_in
74+ ! CHECK: fir.call @_QPpass_intent_out
75+ ! CHECK: hlfir.copy_out
76+ implicit none
77+ integer , target :: x(10 )
78+ integer , pointer :: p(:)
79+ p = > x(:: 2 ) ! pointer to non-contiguous array section
80+ call pass_intent_out(p)
81+ end subroutine
6382end module
You can’t perform that action at this time.
0 commit comments