[flang][openacc] Use OpenACC terminator instead of fir.unreachable after Stop stmt...
[llvm-project.git] / flang / test / Lower / module_use.f90
blob21458bb488430f8f8ba860d0666d6313bbd8fb76
1 ! RUN: bbc -emit-fir %S/module_definition.f90
2 ! RUN: bbc -emit-fir %s -o - | FileCheck %s
4 ! Test use of module data not defined in this file.
5 ! The modules are defined in module_definition.f90
6 ! The first runs ensures the module file is generated.
8 ! CHECK: fir.global common @__BLNK__(dense<0> : vector<4xi8>) : !fir.array<4xi8>
9 ! CHECK-NEXT: fir.global common @named1_(dense<0> : vector<4xi8>) : !fir.array<4xi8>
10 ! CHECK-NEXT: fir.global common @named2_(dense<0> : vector<4xi8>) : !fir.array<4xi8>
12 ! CHECK-LABEL: func @_QPm1use()
13 real function m1use()
14 use m1
15 ! CHECK-DAG: fir.address_of(@_QMm1Ex) : !fir.ref<f32>
16 ! CHECK-DAG: fir.address_of(@_QMm1Ey) : !fir.ref<!fir.array<100xi32>>
17 m1use = x + y(1)
18 end function
20 ! TODO: test equivalences once front-end fix in module file is pushed.
21 !! CHECK-LABEL func @_QPmodeq1use()
22 !real function modEq1use()
23 ! use modEq1
24 ! ! CHECK-DAG fir.address_of(@_QMmodeq1Ex1) : !fir.ref<tuple<!fir.array<36xi8>, !fir.array<40xi8>>>
25 ! ! CHECK-DAG fir.address_of(@_QMmodeq1Ey1) : !fir.ref<tuple<!fir.array<16xi8>, !fir.array<24xi8>>>
26 ! modEq1use = x2(1) + y1
27 !end function
28 ! CHECK-DAG fir.global @_QMmodeq1Ex1 : tuple<!fir.array<36xi8>, !fir.array<40xi8>>
29 ! CHECK-DAG fir.global @_QMmodeq1Ey1 : tuple<!fir.array<16xi8>, !fir.array<24xi8>>
31 ! CHECK-LABEL: func @_QPmodcommon1use()
32 real function modCommon1Use()
33 use modCommonInit1
34 use modCommonNoInit1
35 ! CHECK-DAG: fir.address_of(@named2_) : !fir.ref<!fir.array<4xi8>>
36 ! CHECK-DAG: fir.address_of(@__BLNK__) : !fir.ref<!fir.array<4xi8>>
37 ! CHECK-DAG: fir.address_of(@named1_) : !fir.ref<!fir.array<4xi8>>
38 modCommon1Use = x_blank + x_named1 + i_named2
39 end function
42 ! CHECK-DAG: fir.global @_QMm1Ex : f32
43 ! CHECK-DAG: fir.global @_QMm1Ey : !fir.array<100xi32>