[flang-commits] [flang] [flang][openacc] Allow acc routine before implicit part (PR #71460)
Slava Zakharin via flang-commits
flang-commits at lists.llvm.org
Mon Nov 6 15:55:24 PST 2023
================
@@ -0,0 +1,34 @@
+! This test checks correct lowering when OpenACC routine directive is placed
+! before implicit none.
+
+! RUN: bbc -fopenacc -emit-fir %s -o - | FileCheck %s
+! RUN: bbc -fopenacc -emit-hlfir %s -o - | FileCheck %s
+
+module dummy_mod
+contains
+
+ subroutine sub1(i)
+ !$acc routine seq
+ integer :: i
+ end subroutine
+end module
+
+program test_acc_routine
+ use dummy_mod
+
+ !$acc routine(sub2) seq
+
+ implicit none
+
+ integer :: i
+
+contains
+ subroutine sub2()
+ end subroutine
+
+end program
+
+! CHECK: acc.routine @acc_routine_1 func(@_QFPsub2) seq
+! CHECK: acc.routine @acc_routine_0 func(@_QMdummy_modPsub1) seq
+! CHECK: func.func @_QMdummy_modPsub1(%arg0: !fir.ref<i32> {fir.bindc_name = "i"}) attributes {acc.routine_info = #acc.routine_info<[@acc_routine_0]>}
+! CHECK: func.func @_QQmain() attributes {fir.bindc_name = "test_acc_routine"}
----------------
vzakhari wrote:
Can you please add a check that `sub2` has `acc_routine_1` attached?
https://github.com/llvm/llvm-project/pull/71460
More information about the flang-commits
mailing list