File tree Expand file tree Collapse file tree 3 files changed +39
-2
lines changed Expand file tree Collapse file tree 3 files changed +39
-2
lines changed Original file line number Diff line number Diff line change @@ -413,7 +413,8 @@ struct ImplicitPartStmt {
413
413
Statement<common::Indirection<OldParameterStmt>>,
414
414
Statement<common::Indirection<FormatStmt>>,
415
415
Statement<common::Indirection<EntryStmt>>,
416
- common::Indirection<CompilerDirective>>
416
+ common::Indirection<CompilerDirective>,
417
+ common::Indirection<OpenACCDeclarativeConstruct>>
417
418
u;
418
419
};
419
420
Original file line number Diff line number Diff line change @@ -114,7 +114,8 @@ TYPE_PARSER(first(
114
114
construct<ImplicitPartStmt>(statement(indirect(oldParameterStmt))),
115
115
construct<ImplicitPartStmt>(statement(indirect(formatStmt))),
116
116
construct<ImplicitPartStmt>(statement(indirect(entryStmt))),
117
- construct<ImplicitPartStmt>(indirect(compilerDirective))))
117
+ construct<ImplicitPartStmt>(indirect(compilerDirective)),
118
+ construct<ImplicitPartStmt>(indirect(openaccDeclarativeConstruct))))
118
119
119
120
// R512 internal-subprogram -> function-subprogram | subroutine-subprogram
120
121
// Internal subprograms are not program units, so their END statements
Original file line number Diff line number Diff line change
1
+ ! This test checks correct lowering when OpenACC routine directive is placed
2
+ ! before implicit none.
3
+
4
+ ! RUN: bbc -fopenacc -emit-fir %s -o - | FileCheck %s
5
+ ! RUN: bbc -fopenacc -emit-hlfir %s -o - | FileCheck %s
6
+
7
+ module dummy_mod
8
+ contains
9
+
10
+ subroutine sub1 (i )
11
+ ! $acc routine seq
12
+ integer :: i
13
+ end subroutine
14
+ end module
15
+
16
+ program test_acc_routine
17
+ use dummy_mod
18
+
19
+ ! $acc routine(sub2) seq
20
+
21
+ implicit none
22
+
23
+ integer :: i
24
+
25
+ contains
26
+ subroutine sub2 ()
27
+ end subroutine
28
+
29
+ end program
30
+
31
+ ! CHECK: acc.routine @acc_routine_1 func(@_QFPsub2) seq
32
+ ! CHECK: acc.routine @acc_routine_0 func(@_QMdummy_modPsub1) seq
33
+ ! CHECK: func.func @_QMdummy_modPsub1(%arg0: !fir.ref<i32> {fir.bindc_name = "i"}) attributes {acc.routine_info = #acc.routine_info<[@acc_routine_0]>}
34
+ ! CHECK: func.func @_QQmain() attributes {fir.bindc_name = "test_acc_routine"}
35
+ ! CHECK: func.func @_QFPsub2() attributes {acc.routine_info = #acc.routine_info<[@acc_routine_1]>}
You can’t perform that action at this time.
0 commit comments