[flang-commits] [flang] [flang] Converted five tests from old lowering to new lowering (part 9) (PR #176310)
via flang-commits
flang-commits at lists.llvm.org
Wed Jan 28 02:11:56 PST 2026
================
@@ -128,16 +188,17 @@ subroutine dyn_array_dyn_len_lb(l, n)
subroutine assumed_length_param(n)
character(*), parameter :: c(1)=(/"abcd"/)
integer :: n
- ! CHECK: %[[c4:.*]] = arith.constant 4 : i64
- ! CHECK: fir.store %[[c4]] to %[[tmp:.*]] : !fir.ref<i64>
- ! CHECK-CONST: %[[tmp:.*]] = fir.address_of(@_global_const_.{{.*}}) : !fir.ref<i64>
- ! CHECK-CONST: fir.call @_QPtake_int(%[[tmp]]) {{.*}}: (!fir.ref<i64>) -> ()
+ ! CHECK: %[[VAL_0:.*]] = arith.constant 4 : i64
+ ! CHECK: %[[VAL_1:.*]]:3 = hlfir.associate %[[VAL_0]] {adapt.valuebyref} : (i64) -> (!fir.ref<i64>, !fir.ref<i64>, i1)
+ ! CHECK: fir.call @_QPtake_int(%[[VAL_1]]#0) {{.*}} : (!fir.ref<i64>) -> ()
call take_int(len(c(n), kind=8))
end
! CHECK-LABEL: func @_QPscalar_cst_neg_len
subroutine scalar_cst_neg_len()
character(-1) :: c
- ! CHECK: fir.alloca !fir.char<1,0> {{{.*}}uniq_name = "_QFscalar_cst_neg_lenEc"}
+ ! CHECK: %[[VAL_0:.*]] = arith.constant 0 : index
+ ! CHECK: %[[VAL_1:.*]] = fir.alloca !fir.char<1,0> {bindc_name = "c", uniq_name = "_QFscalar_cst_neg_lenEc"}
+ ! CHECK: %[[VAL_2:.*]]:2 = hlfir.declare %[[VAL_1]] typeparams %[[VAL_0]] {uniq_name = "_QFscalar_cst_neg_lenEc"} : (!fir.ref<!fir.char<1,0>>, index) -> (!fir.ref<!fir.char<1,0>>, !fir.ref<!fir.char<1,0>>)
print *, c
-end subroutine
+end subroutine
----------------
jeanPerier wrote:
nit: missing new line
https://github.com/llvm/llvm-project/pull/176310
More information about the flang-commits
mailing list