26 lines · plain
1// RUN: tco %s | FileCheck %s2// RUN: %flang_fc1 -emit-llvm %s -o - | FileCheck %s3 4// CHECK-LABEL: define void @x(5func.func @x(%arr : !fir.ref<!fir.array<10xf32>>) {6 %1 = arith.constant 0 : index7 %2 = arith.constant 9 : index8 %stepvar = arith.constant 1 : index9 // CHECK: alloca [10 x float], i64 110 %a = fir.alloca !fir.array<10xf32>11 fir.do_loop %iv = %1 to %2 step %stepvar unordered {12 %3 = fir.coordinate_of %arr, %iv : (!fir.ref<!fir.array<10xf32>>, index) -> !fir.ref<f32>13 // CHECK: %[[reg10:.*]] = load float, ptr14 %4 = fir.load %3 : !fir.ref<f32>15 // CHECK: %[[reg11:.*]] = getelementptr [10 x float], ptr16 %5 = fir.coordinate_of %a, %iv : (!fir.ref<!fir.array<10xf32>>, index) -> !fir.ref<f32>17 // CHECK: store float %[[reg10]], ptr %[[reg11]]18 fir.store %4 to %5 : !fir.ref<f32>19 }20 %6 = fir.embox %a : (!fir.ref<!fir.array<10xf32>>) -> !fir.box<!fir.array<10xf32>>21 fir.call @y(%6) : (!fir.box<!fir.array<10xf32>>) -> ()22 return23}24 25func.func private @y(!fir.box<!fir.array<10xf32>>) -> ()26