1 ! RUN: bbc -emit-fir -o - %s | FileCheck %s
3 ! CHECK-LABEL: func @_QQmain
5 ! CHECK-DAG: [[ccc:%[0-9]+]] = fir.alloca !fir.array<4x!fir.char<1,3>> {bindc_name = "ccc", uniq_name = "_QFEccc"}
6 ! CHECK-DAG: [[jjj:%[0-9]+]] = fir.alloca i32 {bindc_name = "jjj", uniq_name = "_QFEjjj"}
8 namelist /nnn
/ jjj
, ccc
10 ccc
= ["aa ", "bb ", "cc ", "dd "]
11 ! CHECK: [[cookie:%[0-9]+]] = fir.call @_FortranAioBeginExternalListOutput
12 ! CHECK: fir.alloca !fir.array<2xtuple<!fir.ref<i8>, !fir.ref<!fir.box<none>>>>
13 ! CHECK: fir.undefined
14 ! CHECK: fir.address_of
15 ! CHECK: fir.insert_value
16 ! CHECK: fir.embox [[jjj]]
17 ! CHECK: fir.insert_value
18 ! CHECK: fir.address_of
19 ! CHECK: fir.insert_value
20 ! CHECK: fir.embox [[ccc]]
21 ! CHECK: fir.insert_value
22 ! CHECK: fir.alloca tuple<!fir.ref<i8>, i64, !fir.ref<!fir.array<2xtuple<!fir.ref<i8>, !fir.ref<!fir.box<none>>>>>>
23 ! CHECK: fir.address_of
24 ! CHECK-COUNT-3: fir.insert_value
25 ! CHECK: fir.call @_FortranAioOutputNamelist([[cookie]]
26 ! CHECK: fir.call @_FortranAioEndIoStatement([[cookie]]
29 ! CHECK: fir.coordinate_of
31 ! CHECK: [[cookie:%[0-9]+]] = fir.call @_FortranAioBeginExternalListOutput
32 ! CHECK: fir.alloca !fir.array<2xtuple<!fir.ref<i8>, !fir.ref<!fir.box<none>>>>
33 ! CHECK: fir.undefined
34 ! CHECK: fir.address_of
35 ! CHECK: fir.insert_value
36 ! CHECK: fir.embox [[jjj]]
37 ! CHECK: fir.insert_value
38 ! CHECK: fir.address_of
39 ! CHECK: fir.insert_value
40 ! CHECK: fir.embox [[ccc]]
41 ! CHECK: fir.insert_value
42 ! CHECK: fir.alloca tuple<!fir.ref<i8>, i64, !fir.ref<!fir.array<2xtuple<!fir.ref<i8>, !fir.ref<!fir.box<none>>>>>>
43 ! CHECK: fir.address_of
44 ! CHECK-COUNT-3: fir.insert_value
45 ! CHECK: fir.call @_FortranAioOutputNamelist([[cookie]]
46 ! CHECK: fir.call @_FortranAioEndIoStatement([[cookie]]
54 ! CHECK: [[xxx:%[0-9]+]] = fir.alloca {{.*}} = "xxx"
55 ! CHECK: [[cookie:%[0-9]+]] = fir.call @_FortranAioBeginExternalListInput
58 ! CHECK: fir.address_of{{.*}}787878
59 ! CHECK: fir.insert_value
60 ! CHECK: fir.shape_shift %c11
61 ! CHECK: fir.embox [[xxx]]
62 ! CHECK: fir.insert_value
64 ! CHECK: fir.undefined
65 ! CHECK: fir.address_of{{.*}}727272
66 ! CHECK-COUNT-3: fir.insert_value
67 ! CHECK: fir.call @_FortranAioInputNamelist([[cookie]]
68 ! CHECK: fir.call @_FortranAioEndIoStatement([[cookie]]
72 ! CHECK-LABEL: global_pointer
73 subroutine global_pointer
74 real,pointer,save::ptrarray(:)
75 ! CHECK: %[[a0:.*]] = fir.address_of
76 namelist/mygroup
/ptrarray
77 ! CHECK: %[[a1:.*]] = fir.convert %[[a0]]
78 ! CHECK: %[[a2:.*]] = fir.call @_FortranAioBeginExternalListOutput({{.*}}, %[[a1]], {{.*}}) {{.*}}: (i32, !fir.ref<i8>, i32) -> !fir.ref<i8>
79 ! CHECK: %[[a3:.*]] = fir.address_of
80 ! CHECK: %[[a4:.*]] = fir.convert %[[a3]]
81 ! CHECK: %[[a5:.*]] = fir.call @_FortranAioOutputNamelist(%[[a2]], %[[a4]])
82 ! CHECK: %[[a6:.*]] = fir.call @_FortranAioEndIoStatement(%[[a2]])
83 write(10, nml
=mygroup
)
86 ! CHECK-DAG: fir.global linkonce @_QQcl.6A6A6A00 constant : !fir.char<1,4>
87 ! CHECK-DAG: fir.global linkonce @_QQcl.63636300 constant : !fir.char<1,4>
88 ! CHECK-DAG: fir.global linkonce @_QQcl.6E6E6E00 constant : !fir.char<1,4>