1 // RUN: tco %s | FileCheck %s
3 // CHECK-LABEL: define void @_QPtest_proc_dummy()
4 // CHECK: %[[VAL_3:.*]] = alloca [32 x i8], i64 1, align 1
5 // CHECK: %[[VAL_1:.*]] = alloca { ptr }, i64 1, align 8
6 // CHECK: %[[VAL_0:.*]] = alloca i32, i64 1, align 4
7 // CHECK: %[[VAL_2:.*]] = getelementptr { ptr }, ptr %[[VAL_1]], i32 0, i32 0
8 // CHECK: store ptr %[[VAL_0]], ptr %[[VAL_2]], align 8
9 // CHECK: store i32 1, ptr %[[VAL_0]], align 4
10 // CHECK: call void @llvm.init.trampoline(ptr %[[VAL_3]], ptr @_QFtest_proc_dummyPtest_proc_dummy_a, ptr %[[VAL_1]])
11 // CHECK: %[[VAL_6:.*]] = call ptr @llvm.adjust.trampoline(ptr %[[VAL_3]])
12 // CHECK: call void @_QPtest_proc_dummy_other(ptr %[[VAL_6]])
14 // CHECK-LABEL: define void @_QFtest_proc_dummyPtest_proc_dummy_a(ptr
15 // CHECK-SAME: nocapture %[[VAL_0:.*]], ptr nest nocapture %[[VAL_1:.*]])
17 // CHECK-LABEL: define void @_QPtest_proc_dummy_other(ptr
18 // CHECK-SAME: %[[VAL_0:.*]])
19 // CHECK: call void %[[VAL_0]](ptr %{{.*}})
21 func.func @_QPtest_proc_dummy() {
22 %c0_i32 = arith.constant 0 : i32
23 %c1_i32 = arith.constant 1 : i32
24 %c-1_i32 = arith.constant -1 : i32
25 %c5_i32 = arith.constant 5 : i32
26 %0 = fir.alloca i32 {bindc_name = "i", uniq_name = "_QFtest_proc_dummyEi"}
27 %1 = fir.alloca tuple<!fir.ref<i32>>
28 %2 = fir.coordinate_of %1, %c0_i32 : (!fir.ref<tuple<!fir.ref<i32>>>, i32) -> !fir.llvm_ptr<!fir.ref<i32>>
29 fir.store %0 to %2 : !fir.llvm_ptr<!fir.ref<i32>>
30 fir.store %c1_i32 to %0 : !fir.ref<i32>
31 %3 = fir.address_of(@_QFtest_proc_dummyPtest_proc_dummy_a) : (!fir.ref<i32>, !fir.ref<tuple<!fir.ref<i32>>>) -> ()
32 %4 = fir.emboxproc %3, %1 : ((!fir.ref<i32>, !fir.ref<tuple<!fir.ref<i32>>>) -> (), !fir.ref<tuple<!fir.ref<i32>>>) -> !fir.boxproc<() -> ()>
33 fir.call @_QPtest_proc_dummy_other(%4) : (!fir.boxproc<() -> ()>) -> ()
34 %5 = fir.address_of(@_QQclX2E2F682E66393000) : !fir.ref<!fir.char<1,8>>
35 %6 = fir.convert %5 : (!fir.ref<!fir.char<1,8>>) -> !fir.ref<i8>
36 %7 = fir.call @_FortranAioBeginExternalListOutput(%c-1_i32, %6, %c5_i32) : (i32, !fir.ref<i8>, i32) -> !fir.ref<i8>
37 %8 = fir.load %0 : !fir.ref<i32>
38 %9 = fir.call @_FortranAioOutputInteger32(%7, %8) : (!fir.ref<i8>, i32) -> i1
39 %10 = fir.call @_FortranAioEndIoStatement(%7) : (!fir.ref<i8>) -> i32
42 func.func @_QFtest_proc_dummyPtest_proc_dummy_a(%arg0: !fir.ref<i32> {fir.bindc_name = "j"}, %arg1: !fir.ref<tuple<!fir.ref<i32>>> {fir.host_assoc}) {
43 %c0_i32 = arith.constant 0 : i32
44 %0 = fir.coordinate_of %arg1, %c0_i32 : (!fir.ref<tuple<!fir.ref<i32>>>, i32) -> !fir.llvm_ptr<!fir.ref<i32>>
45 %1 = fir.load %0 : !fir.llvm_ptr<!fir.ref<i32>>
46 %2 = fir.load %1 : !fir.ref<i32>
47 %3 = fir.load %arg0 : !fir.ref<i32>
48 %4 = arith.addi %2, %3 : i32
49 fir.store %4 to %1 : !fir.ref<i32>
52 func.func @_QPtest_proc_dummy_other(%arg0: !fir.boxproc<() -> ()>) {
53 %c4_i32 = arith.constant 4 : i32
54 %0 = fir.alloca i32 {adapt.valuebyref}
55 fir.store %c4_i32 to %0 : !fir.ref<i32>
56 %1 = fir.box_addr %arg0 : (!fir.boxproc<() -> ()>) -> ((!fir.ref<i32>) -> ())
57 fir.call %1(%0) : (!fir.ref<i32>) -> ()
61 // CHECK-LABEL: define void @_QPtest_proc_dummy_char()
62 // CHECK: %[[VAL_20:.*]] = alloca [32 x i8], i64 1, align 1
63 // CHECK: %[[VAL_2:.*]] = alloca { { ptr, i64 } }, i64 1, align 8
64 // CHECK: %[[VAL_1:.*]] = alloca [10 x i8], i64 1, align 1
65 // CHECK: %[[VAL_0:.*]] = alloca [40 x i8], i64 1, align 1
66 // CHECK: %[[VAL_3:.*]] = getelementptr { { ptr, i64 } }, ptr %[[VAL_2]], i32 0, i32 0
67 // CHECK: %[[VAL_5:.*]] = insertvalue { ptr, i64 } undef, ptr %[[VAL_1]], 0
68 // CHECK: %[[VAL_6:.*]] = insertvalue { ptr, i64 } %[[VAL_5]], i64 10, 1
69 // CHECK: store { ptr, i64 } %[[VAL_6]], ptr %[[VAL_3]], align 8
70 // CHECK: call void @llvm.memmove.p0.p0.i64(ptr %[[VAL_1]], ptr
71 // CHECK: br label %[[VAL_8:.*]]
72 // CHECK: %[[VAL_11:.*]] = phi
73 // CHECK: %[[VAL_13:.*]] = phi
74 // CHECK: %[[VAL_15:.*]] = icmp sgt i64 %[[VAL_13]], 0
75 // CHECK: %[[VAL_18:.*]] = getelementptr [10 x [1 x i8]], ptr %[[VAL_1]], i32 0, i64 %[[VAL_11]]
76 // CHECK: store [1 x i8] c" ", ptr %[[VAL_18]], align 1
77 // CHECK: call void @llvm.init.trampoline(ptr %[[VAL_20]], ptr @_QFtest_proc_dummy_charPgen_message, ptr %[[VAL_2]])
78 // CHECK: %[[VAL_23:.*]] = call ptr @llvm.adjust.trampoline(ptr %[[VAL_20]])
79 // CHECK: %[[VAL_25:.*]] = insertvalue { ptr, i64 } undef, ptr %[[VAL_23]], 0
80 // CHECK: %[[VAL_26:.*]] = insertvalue { ptr, i64 } %[[VAL_25]], i64 10, 1
81 // CHECK: %[[VAL_27:.*]] = call ptr @llvm.stacksave.p0()
82 // CHECK: %[[VAL_28:.*]] = extractvalue { ptr, i64 } %[[VAL_26]], 0
83 // CHECK: %[[VAL_29:.*]] = extractvalue { ptr, i64 } %[[VAL_26]], 1
84 // CHECK: %[[VAL_30:.*]] = call { ptr, i64 } @_QPget_message(ptr %[[VAL_0]], i64 40, ptr %[[VAL_28]], i64 %[[VAL_29]])
85 // CHECK: %[[VAL_32:.*]] = call i1 @_FortranAioOutputAscii(ptr %{{.*}}, ptr %[[VAL_0]], i64 40)
86 // CHECK: call void @llvm.stackrestore.p0(ptr %[[VAL_27]])
88 // CHECK-LABEL: define { ptr, i64 } @_QFtest_proc_dummy_charPgen_message(ptr
89 // CHECK-SAME: nocapture %[[VAL_0:.*]], i64 %[[VAL_1:.*]], ptr nest nocapture %[[VAL_2:.*]])
90 // CHECK: %[[VAL_3:.*]] = getelementptr { { ptr, i64 } }, ptr %[[VAL_2]], i32 0, i32 0
91 // CHECK: %[[VAL_4:.*]] = load { ptr, i64 }, ptr %[[VAL_3]], align 8
92 // CHECK: %[[VAL_5:.*]] = extractvalue { ptr, i64 } %[[VAL_4]], 0
93 // CHECK: %[[VAL_6:.*]] = extractvalue { ptr, i64 } %[[VAL_4]], 1
94 // CHECK: %[[VAL_8:.*]] = icmp sgt i64 %[[VAL_6]], 10
95 // CHECK: %[[VAL_9:.*]] = select i1 %[[VAL_8]], i64 10, i64 %[[VAL_6]]
96 // CHECK: call void @llvm.memmove.p0.p0.i64(ptr %[[VAL_0]], ptr %[[VAL_5]], i64 %[[VAL_9]], i1 false)
97 // CHECK: %[[VAL_10:.*]] = sub i64 10, %[[VAL_9]]
98 // CHECK: br label %[[VAL_11:.*]]
99 // CHECK: %[[VAL_14:.*]] = phi i64
100 // CHECK: %[[VAL_16:.*]] = phi i64
101 // CHECK: %[[VAL_18:.*]] = icmp sgt i64 %[[VAL_16]], 0
102 // CHECK: %[[VAL_21:.*]] = getelementptr [1 x i8], ptr %[[VAL_0]], i64 %[[VAL_14]]
103 // CHECK: store [1 x i8] c" ", ptr %[[VAL_21]], align 1
104 // CHECK: %[[VAL_22:.*]] = insertvalue { ptr, i64 } undef, ptr %[[VAL_0]], 0
105 // CHECK: %[[VAL_23:.*]] = insertvalue { ptr, i64 } %[[VAL_22]], i64 10, 1
106 // CHECK: ret { ptr, i64 } %[[VAL_23]]
109 // CHECK-LABEL: define { ptr, i64 } @_QPget_message(ptr
110 // CHECK-SAME: %[[VAL_0:.*]], i64 %[[VAL_1:.*]], ptr %[[VAL_2:.*]], i64
111 // CHECK-SAME: %[[VAL_3:.*]])
112 // CHECK: %[[VAL_4:.*]] = insertvalue { ptr, i64 } undef, ptr %[[VAL_2]], 0
113 // CHECK: %[[VAL_5:.*]] = insertvalue { ptr, i64 } %[[VAL_4]], i64 %[[VAL_3]], 1
114 // CHECK: %[[VAL_7:.*]] = extractvalue { ptr, i64 } %[[VAL_5]], 0
115 // CHECK: %[[VAL_8:.*]] = extractvalue { ptr, i64 } %[[VAL_5]], 1
116 // CHECK: %[[VAL_9:.*]] = call ptr @llvm.stacksave.p0()
117 // CHECK: %[[VAL_10:.*]] = alloca i8, i64 %[[VAL_8]], align 1
118 // CHECK: %[[VAL_12:.*]] = call { ptr, i64 } %[[VAL_7]](ptr %[[VAL_10]], i64 %[[VAL_8]])
119 // CHECK: %[[VAL_13:.*]] = add i64 %[[VAL_8]], 12
120 // CHECK: %[[VAL_14:.*]] = alloca i8, i64 %[[VAL_13]], align 1
121 // CHECK: call void @llvm.memmove.p0.p0.i64(ptr %[[VAL_14]], ptr {{.*}}, i64 12, i1 false)
122 // CHECK: %[[VAL_18:.*]] = phi i64
123 // CHECK: %[[VAL_20:.*]] = phi i64
124 // CHECK: %[[VAL_22:.*]] = icmp sgt i64 %[[VAL_20]], 0
125 // CHECK: %[[VAL_24:.*]] = sub i64 %[[VAL_18]], 12
126 // CHECK: %[[VAL_26:.*]] = getelementptr [1 x i8], ptr %[[VAL_10]], i64 %[[VAL_24]]
127 // CHECK: %[[VAL_27:.*]] = load [1 x i8], ptr %[[VAL_26]], align 1
128 // CHECK: %[[VAL_29:.*]] = getelementptr [1 x i8], ptr %[[VAL_14]], i64 %[[VAL_18]]
129 // CHECK: store [1 x i8] %[[VAL_27]], ptr %[[VAL_29]], align 1
130 // CHECK: %[[VAL_30:.*]] = icmp sgt i64 %[[VAL_13]], 40
131 // CHECK: %[[VAL_31:.*]] = select i1 %[[VAL_30]], i64 40, i64 %[[VAL_13]]
132 // CHECK: call void @llvm.memmove.p0.p0.i64(ptr %[[VAL_0]], ptr %[[VAL_14]], i64 %[[VAL_31]], i1 false)
133 // CHECK: %[[VAL_32:.*]] = sub i64 40, %[[VAL_31]]
134 // CHECK: %[[VAL_35:.*]] = phi i64
135 // CHECK: %[[VAL_37:.*]] = phi i64
136 // CHECK: %[[VAL_39:.*]] = icmp sgt i64 %[[VAL_37]], 0
137 // CHECK: %[[VAL_42:.*]] = getelementptr [1 x i8], ptr %[[VAL_0]], i64 %[[VAL_35]]
138 // CHECK: store [1 x i8] c" ", ptr %[[VAL_42]], align 1
139 // CHECK: call void @llvm.stackrestore.p0(ptr %[[VAL_9]])
140 // CHECK: %[[VAL_43:.*]] = insertvalue { ptr, i64 } undef, ptr %[[VAL_0]], 0
141 // CHECK: %[[VAL_44:.*]] = insertvalue { ptr, i64 } %[[VAL_43]], i64 40, 1
142 // CHECK: ret { ptr, i64 } %[[VAL_44]]
145 func.func @_QPtest_proc_dummy_char() {
146 %c10 = arith.constant 10 : index
147 %c0_i32 = arith.constant 0 : i32
148 %c9 = arith.constant 9 : index
149 %false = arith.constant false
150 %c1 = arith.constant 1 : index
151 %c32_i8 = arith.constant 32 : i8
152 %c-1_i32 = arith.constant -1 : i32
153 %c6_i32 = arith.constant 6 : i32
154 %c10_i64 = arith.constant 10 : i64
155 %c40 = arith.constant 40 : index
156 %c0 = arith.constant 0 : index
157 %0 = fir.alloca !fir.char<1,40> {bindc_name = ".result"}
158 %1 = fir.alloca !fir.char<1,10> {bindc_name = "message", uniq_name = "_QFtest_proc_dummy_charEmessage"}
159 %2 = fir.alloca tuple<!fir.boxchar<1>>
160 %3 = fir.coordinate_of %2, %c0_i32 : (!fir.ref<tuple<!fir.boxchar<1>>>, i32) -> !fir.ref<!fir.boxchar<1>>
161 %4 = fir.convert %1 : (!fir.ref<!fir.char<1,10>>) -> !fir.ref<!fir.char<1,?>>
162 %5 = fir.emboxchar %4, %c10 : (!fir.ref<!fir.char<1,?>>, index) -> !fir.boxchar<1>
163 fir.store %5 to %3 : !fir.ref<!fir.boxchar<1>>
164 %6 = fir.address_of(@_QQclX486920746865726521) : !fir.ref<!fir.char<1,9>>
165 %7 = fir.convert %c9 : (index) -> i64
166 %8 = fir.convert %1 : (!fir.ref<!fir.char<1,10>>) -> !fir.ref<i8>
167 %9 = fir.convert %6 : (!fir.ref<!fir.char<1,9>>) -> !fir.ref<i8>
168 fir.call @llvm.memmove.p0.p0.i64(%8, %9, %7, %false) : (!fir.ref<i8>, !fir.ref<i8>, i64, i1) -> ()
169 %10 = fir.undefined !fir.char<1>
170 %11 = fir.insert_value %10, %c32_i8, [0 : index] : (!fir.char<1>, i8) -> !fir.char<1>
171 cf.br ^bb1(%c9, %c1 : index, index)
172 ^bb1(%12: index, %13: index): // 2 preds: ^bb0, ^bb2
173 %14 = arith.cmpi sgt, %13, %c0 : index
174 cf.cond_br %14, ^bb2, ^bb3
176 %15 = fir.convert %1 : (!fir.ref<!fir.char<1,10>>) -> !fir.ref<!fir.array<10x!fir.char<1>>>
177 %16 = fir.coordinate_of %15, %12 : (!fir.ref<!fir.array<10x!fir.char<1>>>, index) -> !fir.ref<!fir.char<1>>
178 fir.store %11 to %16 : !fir.ref<!fir.char<1>>
179 %17 = arith.addi %12, %c1 : index
180 %18 = arith.subi %13, %c1 : index
181 cf.br ^bb1(%17, %18 : index, index)
183 %19 = fir.address_of(@_QQclX2E2F682E66393000) : !fir.ref<!fir.char<1,8>>
184 %20 = fir.convert %19 : (!fir.ref<!fir.char<1,8>>) -> !fir.ref<i8>
185 %21 = fir.call @_FortranAioBeginExternalListOutput(%c-1_i32, %20, %c6_i32) : (i32, !fir.ref<i8>, i32) -> !fir.ref<i8>
186 %22 = fir.address_of(@_QFtest_proc_dummy_charPgen_message) : (!fir.ref<!fir.char<1,10>>, index, !fir.ref<tuple<!fir.boxchar<1>>>) -> !fir.boxchar<1>
187 %23 = fir.emboxproc %22, %2 : ((!fir.ref<!fir.char<1,10>>, index, !fir.ref<tuple<!fir.boxchar<1>>>) -> !fir.boxchar<1>, !fir.ref<tuple<!fir.boxchar<1>>>) -> !fir.boxproc<() -> ()>
188 %24 = fir.undefined tuple<!fir.boxproc<() -> ()>, i64>
189 %25 = fir.insert_value %24, %23, [0 : index] : (tuple<!fir.boxproc<() -> ()>, i64>, !fir.boxproc<() -> ()>) -> tuple<!fir.boxproc<() -> ()>, i64>
190 %26 = fir.insert_value %25, %c10_i64, [1 : index] : (tuple<!fir.boxproc<() -> ()>, i64>, i64) -> tuple<!fir.boxproc<() -> ()>, i64>
191 %27 = fir.call @llvm.stacksave.p0() : () -> !fir.ref<i8>
192 %28 = fir.call @_QPget_message(%0, %c40, %26) : (!fir.ref<!fir.char<1,40>>, index, tuple<!fir.boxproc<() -> ()>, i64>) -> !fir.boxchar<1>
193 %29 = fir.convert %0 : (!fir.ref<!fir.char<1,40>>) -> !fir.ref<i8>
194 %30 = fir.convert %c40 : (index) -> i64
195 %31 = fir.call @_FortranAioOutputAscii(%21, %29, %30) : (!fir.ref<i8>, !fir.ref<i8>, i64) -> i1
196 fir.call @llvm.stackrestore.p0(%27) : (!fir.ref<i8>) -> ()
197 %32 = fir.call @_FortranAioEndIoStatement(%21) : (!fir.ref<i8>) -> i32
200 func.func @_QFtest_proc_dummy_charPgen_message(%arg0: !fir.ref<!fir.char<1,10>>, %arg1: index, %arg2: !fir.ref<tuple<!fir.boxchar<1>>> {fir.host_assoc}) -> !fir.boxchar<1> {
201 %c0_i32 = arith.constant 0 : i32
202 %c10 = arith.constant 10 : index
203 %false = arith.constant false
204 %c1 = arith.constant 1 : index
205 %c32_i8 = arith.constant 32 : i8
206 %c0 = arith.constant 0 : index
207 %0 = fir.coordinate_of %arg2, %c0_i32 : (!fir.ref<tuple<!fir.boxchar<1>>>, i32) -> !fir.ref<!fir.boxchar<1>>
208 %1 = fir.load %0 : !fir.ref<!fir.boxchar<1>>
209 %2:2 = fir.unboxchar %1 : (!fir.boxchar<1>) -> (!fir.ref<!fir.char<1,?>>, index)
210 %3 = fir.convert %arg0 : (!fir.ref<!fir.char<1,10>>) -> !fir.ref<!fir.char<1,?>>
211 %4 = arith.cmpi slt, %c10, %2#1 : index
212 %5 = arith.select %4, %c10, %2#1 : index
213 %6 = fir.convert %5 : (index) -> i64
214 %7 = fir.convert %3 : (!fir.ref<!fir.char<1,?>>) -> !fir.ref<i8>
215 %8 = fir.convert %2#0 : (!fir.ref<!fir.char<1,?>>) -> !fir.ref<i8>
216 fir.call @llvm.memmove.p0.p0.i64(%7, %8, %6, %false) : (!fir.ref<i8>, !fir.ref<i8>, i64, i1) -> ()
217 %9 = fir.undefined !fir.char<1>
218 %10 = fir.insert_value %9, %c32_i8, [0 : index] : (!fir.char<1>, i8) -> !fir.char<1>
219 %11 = arith.subi %c10, %5 : index
220 cf.br ^bb1(%5, %11 : index, index)
221 ^bb1(%12: index, %13: index): // 2 preds: ^bb0, ^bb2
222 %14 = arith.cmpi sgt, %13, %c0 : index
223 cf.cond_br %14, ^bb2, ^bb3
225 %15 = fir.convert %3 : (!fir.ref<!fir.char<1,?>>) -> !fir.ref<!fir.array<?x!fir.char<1>>>
226 %16 = fir.coordinate_of %15, %12 : (!fir.ref<!fir.array<?x!fir.char<1>>>, index) -> !fir.ref<!fir.char<1>>
227 fir.store %10 to %16 : !fir.ref<!fir.char<1>>
228 %17 = arith.addi %12, %c1 : index
229 %18 = arith.subi %13, %c1 : index
230 cf.br ^bb1(%17, %18 : index, index)
232 %19 = fir.emboxchar %3, %c10 : (!fir.ref<!fir.char<1,?>>, index) -> !fir.boxchar<1>
233 return %19 : !fir.boxchar<1>
235 func.func @_QPget_message(%arg0: !fir.ref<!fir.char<1,40>>, %arg1: index, %arg2: tuple<!fir.boxproc<() -> ()>, i64> {fir.char_proc}) -> !fir.boxchar<1> {
236 %c40 = arith.constant 40 : index
237 %c12 = arith.constant 12 : index
238 %false = arith.constant false
239 %c1 = arith.constant 1 : index
240 %c32_i8 = arith.constant 32 : i8
241 %c0 = arith.constant 0 : index
242 %0 = fir.convert %arg0 : (!fir.ref<!fir.char<1,40>>) -> !fir.ref<!fir.char<1,?>>
243 %1 = fir.address_of(@_QQclX6D6573736167652069733A20) : !fir.ref<!fir.char<1,12>>
244 %2 = fir.extract_value %arg2, [0 : index] : (tuple<!fir.boxproc<() -> ()>, i64>) -> !fir.boxproc<() -> ()>
245 %3 = fir.box_addr %2 : (!fir.boxproc<() -> ()>) -> (() -> ())
246 %4 = fir.extract_value %arg2, [1 : index] : (tuple<!fir.boxproc<() -> ()>, i64>) -> i64
247 %5 = fir.call @llvm.stacksave.p0() : () -> !fir.ref<i8>
248 %6 = fir.alloca !fir.char<1,?>(%4 : i64) {bindc_name = ".result"}
249 %7 = fir.convert %3 : (() -> ()) -> ((!fir.ref<!fir.char<1,?>>, index) -> !fir.boxchar<1>)
250 %8 = fir.convert %4 : (i64) -> index
251 %9 = fir.call %7(%6, %8) : (!fir.ref<!fir.char<1,?>>, index) -> !fir.boxchar<1>
252 %10 = arith.addi %8, %c12 : index
253 %11 = fir.alloca !fir.char<1,?>(%10 : index) {bindc_name = ".chrtmp"}
254 %12 = fir.convert %c12 : (index) -> i64
255 %13 = fir.convert %11 : (!fir.ref<!fir.char<1,?>>) -> !fir.ref<i8>
256 %14 = fir.convert %1 : (!fir.ref<!fir.char<1,12>>) -> !fir.ref<i8>
257 fir.call @llvm.memmove.p0.p0.i64(%13, %14, %12, %false) : (!fir.ref<i8>, !fir.ref<i8>, i64, i1) -> ()
258 cf.br ^bb1(%c12, %8 : index, index)
259 ^bb1(%15: index, %16: index): // 2 preds: ^bb0, ^bb2
260 %17 = arith.cmpi sgt, %16, %c0 : index
261 cf.cond_br %17, ^bb2, ^bb3
263 %18 = arith.subi %15, %c12 : index
264 %19 = fir.convert %6 : (!fir.ref<!fir.char<1,?>>) -> !fir.ref<!fir.array<?x!fir.char<1>>>
265 %20 = fir.coordinate_of %19, %18 : (!fir.ref<!fir.array<?x!fir.char<1>>>, index) -> !fir.ref<!fir.char<1>>
266 %21 = fir.load %20 : !fir.ref<!fir.char<1>>
267 %22 = fir.convert %11 : (!fir.ref<!fir.char<1,?>>) -> !fir.ref<!fir.array<?x!fir.char<1>>>
268 %23 = fir.coordinate_of %22, %15 : (!fir.ref<!fir.array<?x!fir.char<1>>>, index) -> !fir.ref<!fir.char<1>>
269 fir.store %21 to %23 : !fir.ref<!fir.char<1>>
270 %24 = arith.addi %15, %c1 : index
271 %25 = arith.subi %16, %c1 : index
272 cf.br ^bb1(%24, %25 : index, index)
274 %26 = arith.cmpi slt, %c40, %10 : index
275 %27 = arith.select %26, %c40, %10 : index
276 %28 = fir.convert %27 : (index) -> i64
277 %29 = fir.convert %0 : (!fir.ref<!fir.char<1,?>>) -> !fir.ref<i8>
278 fir.call @llvm.memmove.p0.p0.i64(%29, %13, %28, %false) : (!fir.ref<i8>, !fir.ref<i8>, i64, i1) -> ()
279 %30 = fir.undefined !fir.char<1>
280 %31 = fir.insert_value %30, %c32_i8, [0 : index] : (!fir.char<1>, i8) -> !fir.char<1>
281 %32 = arith.subi %c40, %27 : index
282 cf.br ^bb4(%27, %32 : index, index)
283 ^bb4(%33: index, %34: index): // 2 preds: ^bb3, ^bb5
284 %35 = arith.cmpi sgt, %34, %c0 : index
285 cf.cond_br %35, ^bb5, ^bb6
287 %36 = fir.convert %0 : (!fir.ref<!fir.char<1,?>>) -> !fir.ref<!fir.array<?x!fir.char<1>>>
288 %37 = fir.coordinate_of %36, %33 : (!fir.ref<!fir.array<?x!fir.char<1>>>, index) -> !fir.ref<!fir.char<1>>
289 fir.store %31 to %37 : !fir.ref<!fir.char<1>>
290 %38 = arith.addi %33, %c1 : index
291 %39 = arith.subi %34, %c1 : index
292 cf.br ^bb4(%38, %39 : index, index)
294 fir.call @llvm.stackrestore.p0(%5) : (!fir.ref<i8>) -> ()
295 %40 = fir.emboxchar %0, %c40 : (!fir.ref<!fir.char<1,?>>, index) -> !fir.boxchar<1>
296 return %40 : !fir.boxchar<1>
298 fir.global linkonce @_QQclX486920746865726521 constant : !fir.char<1,9> {
299 %0 = fir.string_lit "Hi there!"(9) : !fir.char<1,9>
300 fir.has_value %0 : !fir.char<1,9>
302 func.func private @llvm.memmove.p0.p0.i64(!fir.ref<i8>, !fir.ref<i8>, i64, i1)
303 fir.global linkonce @_QQclX2E2F682E66393000 constant : !fir.char<1,8> {
304 %0 = fir.string_lit "./h.f90\00"(8) : !fir.char<1,8>
305 fir.has_value %0 : !fir.char<1,8>
307 func.func private @llvm.stacksave.p0() -> !fir.ref<i8>
308 func.func private @llvm.stackrestore.p0(!fir.ref<i8>)
309 fir.global linkonce @_QQclX6D6573736167652069733A20 constant : !fir.char<1,12> {
310 %0 = fir.string_lit "message is: "(12) : !fir.char<1,12>
311 fir.has_value %0 : !fir.char<1,12>
314 func.func private @_FortranAioOutputAscii(!fir.ref<i8>, !fir.ref<i8>, i64) -> i1 attributes {fir.io, fir.runtime}
315 func.func private @_FortranAioBeginExternalListOutput(i32, !fir.ref<i8>, i32) -> !fir.ref<i8> attributes {fir.io, fir.runtime}
316 func.func private @_FortranAioOutputInteger32(!fir.ref<i8>, i32) -> i1 attributes {fir.io, fir.runtime}
317 func.func private @_FortranAioEndIoStatement(!fir.ref<i8>) -> i32 attributes {fir.io, fir.runtime}