| 1 |
! This test checks correct lowering when OpenACC routine directive is placed |
| 2 |
! before implicit none. |
| 3 |
|
| 4 |
! RUN: bbc -fopenacc -emit-hlfir %s -o - | FileCheck %s |
| 5 |
|
| 6 |
module dummy_mod |
| 7 |
contains |
| 8 |
|
| 9 |
subroutine sub1(i) |
| 10 |
!$acc routine seq |
| 11 |
integer :: i |
| 12 |
end subroutine |
| 13 |
end module |
| 14 |
|
| 15 |
program test_acc_routine |
| 16 |
use dummy_mod |
| 17 |
|
| 18 |
!$acc routine(sub2) seq |
| 19 |
|
| 20 |
implicit none |
| 21 |
|
| 22 |
integer :: i |
| 23 |
|
| 24 |
contains |
| 25 |
subroutine sub2() |
| 26 |
end subroutine |
| 27 |
|
| 28 |
end program |
| 29 |
|
| 30 |
! CHECK: acc.routine @acc_routine_1 func(@_QFPsub2) seq |
| 31 |
! CHECK: acc.routine @acc_routine_0 func(@_QMdummy_modPsub1) seq |
| 32 |
! CHECK: func.func @_QMdummy_modPsub1(%arg0: !fir.ref<i32> {fir.bindc_name = "i"}) attributes {acc.routine_info = #acc.routine_info<[@acc_routine_0]>} |
| 33 |
! CHECK: func.func @_QQmain() attributes {fir.bindc_name = "test_acc_routine"} |
| 34 |
! CHECK: func.func private @_QFPsub2() attributes {acc.routine_info = #acc.routine_info<[@acc_routine_1]>, fir.host_symbol = @_QQmain, llvm.linkage = #llvm.linkage<internal>} |