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()
15 ! CHECK-DAG: fir.address_of(@_QMm1Ex) : !fir.ref<f32>
16 ! CHECK-DAG: fir.address_of(@_QMm1Ey) : !fir.ref<!fir.array<100xi32>>
20 ! TODO: test equivalences once front-end fix in module file is pushed.
21 !! CHECK-LABEL func @_QPmodeq1use()
22 !real function modEq1use()
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
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()
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
42 ! CHECK-DAG: fir.global @_QMm1Ex : f32
43 ! CHECK-DAG: fir.global @_QMm1Ey : !fir.array<100xi32>