File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ ! RUN: bbc -emit-hlfir -o - %s | FileCheck %s
2+ ! Ensure that we still create copy_in/copy_out for non-contiguous input,
3+ ! despite having IGNORE_TKR.
4+ !
5+ module test
6+ implicit none (type, external )
7+ contains
8+ subroutine pass_ignore_tkr (buf , n )
9+ implicit none
10+ ! DIR$ IGNORE_TKR buf
11+ real , intent (inout ) :: buf(n)
12+ integer , intent (in ) :: n
13+ end subroutine
14+
15+ subroutine s1 ()
16+
17+ ! CHECK-LABEL: func.func @_QMtestPs1()
18+ ! CHECK: hlfir.copy_in
19+ ! CHECK: fir.call @_QMtestPpass_ignore_tkr
20+ ! CHECK: hlfir.copy_out
21+
22+ integer :: x(5 )
23+ x = [1 ,2 ,3 ,4 ,5 ]
24+ ! Non-contiguous input
25+ call pass_ignore_tkr(x(1 :: 2 ), size (x(1 :: 2 )))
26+
27+ end subroutine s1
28+
29+ subroutine s2 ()
30+
31+ ! CHECK-LABEL: func.func @_QMtestPs2()
32+ ! CHECK-NOT: hlfir.copy_in
33+ ! CHECK: fir.call @_QMtestPpass_ignore_tkr
34+ ! CHECK-NOT: hlfir.copy_out
35+
36+ integer :: x(5 )
37+ x = [1 ,2 ,3 ,4 ,5 ]
38+ ! Contiguous input
39+ call pass_ignore_tkr(x(1 :3 ), size (x(1 :3 )))
40+
41+ end subroutine s2
42+ end module test
43+
44+
45+ end program
You can’t perform that action at this time.
0 commit comments