@@ -184,3 +184,34 @@ func.func private @_QFPtest7(%arg0: !fir.ref<tuple<!fir.box<!fir.array<2x2xi32>>
184
184
// CHECK: hlfir.assign %[[VAL_0]] to %[[VAL_2]] : i32, !fir.ref<i32>
185
185
// CHECK: }
186
186
// CHECK: }
187
+
188
+ func.func @_QPtest8() {
189
+ %0 = fir.dummy_scope : !fir.dscope
190
+ %1 = fir.alloca !fir.array<120xi8> {uniq_name = "_QFtest8Ea"}
191
+ %c0 = arith.constant 0 : index
192
+ %2 = fir.coordinate_of %1, %c0 : (!fir.ref<!fir.array<120xi8>>, index) -> !fir.ref<i8>
193
+ %3 = fir.convert %2 : (!fir.ref<i8>) -> !fir.ptr<!fir.array<2x10xf32>>
194
+ %c2 = arith.constant 2 : index
195
+ %c10 = arith.constant 10 : index
196
+ %4 = fir.shape %c2, %c10 : (index, index) -> !fir.shape<2>
197
+ %5:2 = hlfir.declare %3(%4) {uniq_name = "_QFtest8Ea"} : (!fir.ptr<!fir.array<2x10xf32>>, !fir.shape<2>) -> (!fir.ptr<!fir.array<2x10xf32>>, !fir.ptr<!fir.array<2x10xf32>>)
198
+ %c0_0 = arith.constant 0 : index
199
+ %6 = fir.coordinate_of %1, %c0_0 : (!fir.ref<!fir.array<120xi8>>, index) -> !fir.ref<i8>
200
+ %7 = fir.convert %6 : (!fir.ref<i8>) -> !fir.ptr<!fir.array<30xf32>>
201
+ %c30 = arith.constant 30 : index
202
+ %8 = fir.shape %c30 : (index) -> !fir.shape<1>
203
+ %9:2 = hlfir.declare %7(%8) {uniq_name = "_QFtest8Eb"} : (!fir.ptr<!fir.array<30xf32>>, !fir.shape<1>) -> (!fir.ptr<!fir.array<30xf32>>, !fir.ptr<!fir.array<30xf32>>)
204
+ %cst = arith.constant -1.000000e+00 : f32
205
+ hlfir.assign %cst to %5#0 : f32, !fir.ptr<!fir.array<2x10xf32>>
206
+ return
207
+ }
208
+
209
+ // CHECK-LABEL: func.func @_QPtest8() {
210
+ // CHECK: %[[VAL_0:.*]] = arith.constant -1.000000e+00 : f32
211
+ // CHECK: %[[VAL_1:.*]]:2 = hlfir.declare %{{.*}}(%{{.*}}) {uniq_name = "_QFtest8Ea"} : (!fir.ptr<!fir.array<2x10xf32>>, !fir.shape<2>) -> (!fir.ptr<!fir.array<2x10xf32>>, !fir.ptr<!fir.array<2x10xf32>>)
212
+ // CHECK: %[[VAL_2:.*]] = fir.convert %[[VAL_1]]#0 : (!fir.ptr<!fir.array<2x10xf32>>) -> !fir.ref<!fir.array<20xf32>>
213
+ // CHECK: fir.do_loop %[[VAL_3:.*]] = %{{.*}} to %{{.*}} step %{{.*}} unordered {
214
+ // CHECK: %[[VAL_4:.*]] = hlfir.designate %[[VAL_2]] (%[[VAL_3]]) : (!fir.ref<!fir.array<20xf32>>, index) -> !fir.ref<f32>
215
+ // CHECK: hlfir.assign %[[VAL_0]] to %[[VAL_4]] : f32, !fir.ref<f32>
216
+ // CHECK: }
217
+ // CHECK: }
0 commit comments