[flang-commits] [flang] [flang][NFC] Converted five tests from old lowering to new lowering (part 7) (PR #175703)
Eugene Epshteyn via flang-commits
flang-commits at lists.llvm.org
Tue Jan 13 19:17:13 PST 2026
https://github.com/eugeneepshteyn updated https://github.com/llvm/llvm-project/pull/175703
>From 99148e7924f5afed3270944665725400fd46699d Mon Sep 17 00:00:00 2001
From: Eugene Epshteyn <eepshteyn at nvidia.com>
Date: Mon, 12 Jan 2026 22:12:09 -0500
Subject: [PATCH] [flang][NFC] Converted five tests from old lowering to new
lowering (part 7)
Tests converted: array-wide-char.f90, associate-construct-2.f90,
assumed-shape-callee.f90, assumed-type.f90, basic-call.f90
---
flang/test/Lower/array-wide-char.f90 | 6 ++-
flang/test/Lower/associate-construct-2.f90 | 35 ++++++++------
flang/test/Lower/assumed-shape-callee.f90 | 53 ++++++++++++++--------
flang/test/Lower/assumed-type.f90 | 11 +++--
flang/test/Lower/basic-call.f90 | 19 ++++----
5 files changed, 74 insertions(+), 50 deletions(-)
diff --git a/flang/test/Lower/array-wide-char.f90 b/flang/test/Lower/array-wide-char.f90
index 44fcd45519d85..6794589ca6c6e 100644
--- a/flang/test/Lower/array-wide-char.f90
+++ b/flang/test/Lower/array-wide-char.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -hlfir=false %s -o - | tco | FileCheck %s
+! RUN: bbc -emit-hlfir %s -o - | tco | FileCheck %s
character(LEN=128, KIND=4), PARAMETER :: conarr(3) = &
[ character(128,4) :: "now is the time", "for all good men to come", &
@@ -27,4 +27,6 @@ end subroutine sub1
! CHECK: call void @_QPaction_on_char4(ptr @_QFEarr, i64 10)
! CHECK-LABEL: define void @_QPsub1(
-! CHECK: call void @_QPsub2(ptr @_QQcl[[inline]], i64 63)
+! CHECK: %[[VAL_1:.*]] = alloca [63 x i32]
+! CHECK: call void @llvm.memmove.{{.*}}(ptr %[[VAL_1]], ptr @_QQcl[[inline]],
+! CHECK: call void @_QPsub2(ptr %{{.*}}, i64 {{.*}})
diff --git a/flang/test/Lower/associate-construct-2.f90 b/flang/test/Lower/associate-construct-2.f90
index 80864858ed288..47cf7e176bc4b 100644
--- a/flang/test/Lower/associate-construct-2.f90
+++ b/flang/test/Lower/associate-construct-2.f90
@@ -1,21 +1,25 @@
-! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s
+! RUN: bbc -emit-hlfir %s -o - | FileCheck %s
! CHECK-LABEL: func @_QPtest1(
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<!fir.array<100xf32>>{{.*}}, %[[VAL_1:.*]]: !fir.ref<i32>{{.*}}, %[[VAL_2:.*]]: !fir.ref<i32>{{.*}}, %[[VAL_3:.*]]: !fir.ref<i32>{{.*}}) {
! CHECK: %[[VAL_4:.*]] = arith.constant 100 : index
-! CHECK: %[[VAL_5:.*]] = fir.load %[[VAL_1]] : !fir.ref<i32>
-! CHECK: %[[VAL_6:.*]] = fir.convert %[[VAL_5]] : (i32) -> i64
-! CHECK: %[[VAL_7:.*]] = fir.convert %[[VAL_6]] : (i64) -> index
-! CHECK: %[[VAL_8:.*]] = fir.load %[[VAL_3]] : !fir.ref<i32>
-! CHECK: %[[VAL_9:.*]] = fir.convert %[[VAL_8]] : (i32) -> i64
-! CHECK: %[[VAL_10:.*]] = fir.convert %[[VAL_9]] : (i64) -> index
-! CHECK: %[[VAL_11:.*]] = fir.load %[[VAL_2]] : !fir.ref<i32>
-! CHECK: %[[VAL_12:.*]] = fir.convert %[[VAL_11]] : (i32) -> i64
-! CHECK: %[[VAL_13:.*]] = fir.convert %[[VAL_12]] : (i64) -> index
-! CHECK: %[[VAL_14:.*]] = fir.shape %[[VAL_4]] : (index) -> !fir.shape<1>
-! CHECK: %[[VAL_15:.*]] = fir.slice %[[VAL_7]], %[[VAL_13]], %[[VAL_10]] : (index, index, index) -> !fir.slice<1>
-! CHECK: %[[VAL_16:.*]] = fir.embox %[[VAL_0]](%[[VAL_14]]) {{\[}}%[[VAL_15]]] : (!fir.ref<!fir.array<100xf32>>, !fir.shape<1>, !fir.slice<1>) -> !fir.box<!fir.array<?xf32>>
-! CHECK: fir.call @_QPbob(%[[VAL_16]]) {{.*}}: (!fir.box<!fir.array<?xf32>>) -> ()
+! CHECK: %[[VAL_5:.*]] = fir.shape %[[VAL_4]] : (index) -> !fir.shape<1>
+! CHECK: %[[VAL_6:.*]]:2 = hlfir.declare %[[VAL_0]](%[[VAL_5]]) {{.*}}
+! CHECK: %[[VAL_7:.*]]:2 = hlfir.declare %[[VAL_1]] {{.*}}
+! CHECK: %[[VAL_8:.*]]:2 = hlfir.declare %[[VAL_2]] {{.*}}
+! CHECK: %[[VAL_9:.*]]:2 = hlfir.declare %[[VAL_3]] {{.*}}
+! CHECK: %[[VAL_10:.*]] = fir.load %[[VAL_7]]#0 : !fir.ref<i32>
+! CHECK: %[[VAL_11:.*]] = fir.convert %[[VAL_10]] : (i32) -> i64
+! CHECK: %[[VAL_12:.*]] = fir.load %[[VAL_8]]#0 : !fir.ref<i32>
+! CHECK: %[[VAL_13:.*]] = fir.convert %[[VAL_12]] : (i32) -> i64
+! CHECK: %[[VAL_14:.*]] = fir.convert %[[VAL_11]] : (i64) -> index
+! CHECK: %[[VAL_15:.*]] = fir.convert %[[VAL_13]] : (i64) -> index
+! CHECK: %[[VAL_16:.*]] = fir.load %[[VAL_9]]#0 : !fir.ref<i32>
+! CHECK: %[[VAL_17:.*]] = fir.convert %[[VAL_16]] : (i32) -> i64
+! CHECK: %[[VAL_18:.*]] = fir.convert %[[VAL_17]] : (i64) -> index
+! CHECK: %[[VAL_19:.*]] = hlfir.designate %[[VAL_6]]#0 (%[[VAL_14]]:%[[VAL_15]]:%[[VAL_18]]) shape %{{.*}} : (!fir.ref<!fir.array<100xf32>>, index, index, index, !fir.shape<1>) -> !fir.box<!fir.array<?xf32>>
+! CHECK: %[[VAL_20:.*]]:2 = hlfir.declare %[[VAL_19]] {{.*}}
+! CHECK: fir.call @_QPbob(%[[VAL_20]]#0) {{.*}}: (!fir.box<!fir.array<?xf32>>) -> ()
! CHECK: return
! CHECK: }
@@ -39,7 +43,8 @@ end subroutine test1
subroutine test2(n)
integer :: n
integer, external :: foo
- ! CHECK: %[[n:.*]] = fir.load %[[nadd]] : !fir.ref<i32>
+ ! CHECK: %[[n_decl:.*]]:2 = hlfir.declare %[[nadd]] {{.*}}
+ ! CHECK: %[[n:.*]] = fir.load %[[n_decl]]#0 : !fir.ref<i32>
! CHECK: %[[n10:.*]] = arith.addi %[[n]], %c10{{.*}} : i32
! CHECK: fir.store %[[n10]] to %{{.*}} : !fir.ref<i32>
! CHECK: %[[foo:.*]] = fir.call @_QPfoo(%{{.*}}) {{.*}}: (!fir.ref<i32>) -> i32
diff --git a/flang/test/Lower/assumed-shape-callee.f90 b/flang/test/Lower/assumed-shape-callee.f90
index 69abf05139af0..3f442c39cfd87 100644
--- a/flang/test/Lower/assumed-shape-callee.f90
+++ b/flang/test/Lower/assumed-shape-callee.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s
+! RUN: bbc -emit-hlfir %s -o - | FileCheck %s
! Test assumed shape dummy argument on callee side
@@ -15,12 +15,14 @@ subroutine test_assumed_shape_1(x)
! CHECK: %[[c0:.*]] = arith.constant 0 : index
! CHECK: %[[dims:.*]]:3 = fir.box_dims %arg0, %[[c0]] : (!fir.box<!fir.array<?xi32>>, index) -> (index, index, index)
! CHECK: %[[c1:.*]] = arith.constant 1 : index
+ ! CHECK: %[[shape_decl:.*]] = fir.shape_shift %[[c1]], %[[dims]]#1 : (index, index) -> !fir.shapeshift<1>
+ ! CHECK: %[[decl:.*]]:2 = hlfir.declare %[[addr]](%[[shape_decl]]) dummy_scope %{{.*}} arg 1 {fortran_attrs = #fir.var_attrs<contiguous>, uniq_name = "_QFtest_assumed_shape_1Ex"} : (!fir.ref<!fir.array<?xi32>>, !fir.shapeshift<1>, !fir.dscope) -> (!fir.box<!fir.array<?xi32>>, !fir.ref<!fir.array<?xi32>>)
print *, x
! Test extent/lower bound use in the IO statement
! CHECK: %[[cookie:.*]] = fir.call @_FortranAioBeginExternalListOutput
! CHECK: %[[shape:.*]] = fir.shape_shift %[[c1]], %[[dims]]#1 : (index, index) -> !fir.shapeshift<1>
- ! CHECK: %[[newbox:.*]] = fir.embox %[[addr]](%[[shape]]) : (!fir.ref<!fir.array<?xi32>>, !fir.shapeshift<1>) -> !fir.box<!fir.array<?xi32>>
+ ! CHECK: %[[newbox:.*]] = fir.embox %[[decl]]#1(%[[shape]]) : (!fir.ref<!fir.array<?xi32>>, !fir.shapeshift<1>) -> !fir.box<!fir.array<?xi32>>
! CHECK: %[[castedBox:.*]] = fir.convert %[[newbox]] : (!fir.box<!fir.array<?xi32>>) -> !fir.box<none>
! CHECK: fir.call @_FortranAioOutputDescriptor(%[[cookie]], %[[castedBox]]) {{.*}}: (!fir.ref<i8>, !fir.box<none>) -> i1
end subroutine
@@ -29,45 +31,53 @@ subroutine test_assumed_shape_1(x)
! CHECK-LABEL: func @_QPtest_assumed_shape_2(%arg0: !fir.box<!fir.array<?x?xf32>> {fir.bindc_name = "x", fir.contiguous})
subroutine test_assumed_shape_2(x)
real, contiguous :: x(1:, 1:)
- ! CHECK: fir.box_addr
- ! CHECK: %[[dims1:.*]]:3 = fir.box_dims
- ! CHECK: %[[dims2:.*]]:3 = fir.box_dims
+ ! CHECK: %[[addr:.*]] = fir.box_addr %arg0
+ ! CHECK: %[[dims1:.*]]:3 = fir.box_dims %arg0, %c0
+ ! CHECK: %[[dims2:.*]]:3 = fir.box_dims %arg0, %c1
+ ! CHECK: %[[shape_decl:.*]] = fir.shape %[[dims1]]#1, %[[dims2]]#1
+ ! CHECK: %[[decl:.*]]:2 = hlfir.declare %[[addr]](%[[shape_decl]]) {{.*}}
print *, x
! CHECK: fir.call @_FortranAioBeginExternalListOutput
- ! CHECK: fir.shape %[[dims1]]#1, %[[dims2]]#1
+ ! CHECK: %[[shape:.*]] = fir.shape %[[dims1]]#1, %[[dims2]]#1
+ ! CHECK: %[[newbox:.*]] = fir.embox %[[decl]]#1(%[[shape]])
end subroutine
! explicit lower bounds different from 1
! CHECK-LABEL: func @_QPtest_assumed_shape_3(%arg0: !fir.box<!fir.array<?x?x?xi32>> {fir.bindc_name = "x", fir.contiguous})
subroutine test_assumed_shape_3(x)
integer, contiguous :: x(2:, 3:, 42:)
- ! CHECK: fir.box_addr
- ! CHECK: fir.box_dim
+ ! CHECK: %[[addr:.*]] = fir.box_addr %arg0
+ ! CHECK: %[[dims1:.*]]:3 = fir.box_dims %arg0, %c0
! CHECK: %[[c2_i64:.*]] = arith.constant 2 : i64
! CHECK: %[[c2:.*]] = fir.convert %[[c2_i64]] : (i64) -> index
- ! CHECK: fir.box_dim
+ ! CHECK: %[[dims2:.*]]:3 = fir.box_dims %arg0, %c1
! CHECK: %[[c3_i64:.*]] = arith.constant 3 : i64
! CHECK: %[[c3:.*]] = fir.convert %[[c3_i64]] : (i64) -> index
- ! CHECK: fir.box_dim
+ ! CHECK: %[[dims3:.*]]:3 = fir.box_dims %arg0, %c2
! CHECK: %[[c42_i64:.*]] = arith.constant 42 : i64
! CHECK: %[[c42:.*]] = fir.convert %[[c42_i64]] : (i64) -> index
+ ! CHECK: %[[shape_decl:.*]] = fir.shape_shift %[[c2]], %[[dims1]]#1, %[[c3]], %[[dims2]]#1, %[[c42]], %[[dims3]]#1
+ ! CHECK: %[[decl:.*]]:2 = hlfir.declare %[[addr]](%[[shape_decl]]) {{.*}}
print *, x
- ! CHECK: fir.shape_shift %[[c2]], %{{.*}}, %[[c3]], %{{.*}}, %[[c42]], %{{.*}} :
+ ! CHECK: %[[shape:.*]] = fir.shape_shift %[[c2]], %{{.*}}, %[[c3]], %{{.*}}, %[[c42]], %{{.*}} :
+ ! CHECK: fir.embox %[[decl]]#1(%[[shape]])
end subroutine
! Constant length
-! func @_QPtest_assumed_shape_char(%arg0: !fir.box<!fir.array<?x!fir.char<1,10>>> {fir.bindc_name = "c", fir.contiguous})
+! CHECK-LABEL: func @_QPtest_assumed_shape_char(%arg0: !fir.box<!fir.array<?x!fir.char<1,10>>> {fir.bindc_name = "c", fir.contiguous})
subroutine test_assumed_shape_char(c)
character(10), contiguous :: c(:)
! CHECK: %[[addr:.*]] = fir.box_addr %arg0 : (!fir.box<!fir.array<?x!fir.char<1,10>>>) -> !fir.ref<!fir.array<?x!fir.char<1,10>>>
! CHECK: %[[dims:.*]]:3 = fir.box_dims %arg0, %c0 : (!fir.box<!fir.array<?x!fir.char<1,10>>>, index) -> (index, index, index)
! CHECK: %[[c1:.*]] = arith.constant 1 : index
+ ! CHECK: %[[shape_decl:.*]] = fir.shape_shift %[[c1]], %[[dims]]#1 : (index, index) -> !fir.shapeshift<1>
+ ! CHECK: %[[decl:.*]]:2 = hlfir.declare %[[addr]](%[[shape_decl]]) {{.*}}
print *, c
! CHECK: %[[shape:.*]] = fir.shape_shift %[[c1]], %[[dims]]#1 : (index, index) -> !fir.shapeshift<1>
- ! CHECK: fir.embox %[[addr]](%[[shape]]) : (!fir.ref<!fir.array<?x!fir.char<1,10>>>, !fir.shapeshift<1>) -> !fir.box<!fir.array<?x!fir.char<1,10>>>
+ ! CHECK: fir.embox %[[decl]]#1(%[[shape]]) : (!fir.ref<!fir.array<?x!fir.char<1,10>>>, !fir.shapeshift<1>) -> !fir.box<!fir.array<?x!fir.char<1,10>>>
end subroutine
! Assumed length
@@ -79,10 +89,12 @@ subroutine test_assumed_shape_char_2(c)
! CHECK: %[[dims:.*]]:3 = fir.box_dims %arg0, %c0 : (!fir.box<!fir.array<?x!fir.char<1,?>>>, index) -> (index, index, index)
! CHECK: %[[c1:.*]] = arith.constant 1 : index
+ ! CHECK: %[[shape_decl:.*]] = fir.shape_shift %[[c1]], %[[dims]]#1 : (index, index) -> !fir.shapeshift<1>
+ ! CHECK: %[[decl:.*]]:2 = hlfir.declare %[[addr]](%[[shape_decl]]) typeparams %[[len]] {{.*}}
print *, c
! CHECK: %[[shape:.*]] = fir.shape_shift %[[c1]], %[[dims]]#1 : (index, index) -> !fir.shapeshift<1>
- ! CHECK: fir.embox %[[addr]](%[[shape]]) typeparams %[[len]] : (!fir.ref<!fir.array<?x!fir.char<1,?>>>, !fir.shapeshift<1>, index) -> !fir.box<!fir.array<?x!fir.char<1,?>>>
+ ! CHECK: fir.embox %[[decl]]#1(%[[shape]]) typeparams %[[len]] : (!fir.ref<!fir.array<?x!fir.char<1,?>>>, !fir.shapeshift<1>, index) -> !fir.box<!fir.array<?x!fir.char<1,?>>>
end subroutine
@@ -90,11 +102,14 @@ subroutine test_assumed_shape_char_2(c)
! CHECK: func @_QPtest_assumed_shape_char_3(%arg0: !fir.box<!fir.array<?x?x!fir.char<1,?>>> {fir.bindc_name = "c", fir.contiguous})
subroutine test_assumed_shape_char_3(c)
character(*), contiguous :: c(1:, 1:)
- ! CHECK: fir.box_addr
- ! CHECK: fir.box_elesize
- ! CHECK: %[[dims1:.*]]:3 = fir.box_dims
- ! CHECK: %[[dims2:.*]]:3 = fir.box_dims
+ ! CHECK: %[[addr:.*]] = fir.box_addr %arg0
+ ! CHECK: %[[len:.*]] = fir.box_elesize %arg0
+ ! CHECK: %[[dims1:.*]]:3 = fir.box_dims %arg0, %c0
+ ! CHECK: %[[dims2:.*]]:3 = fir.box_dims %arg0, %c1
+ ! CHECK: %[[shape_decl:.*]] = fir.shape %[[dims1]]#1, %[[dims2]]#1
+ ! CHECK: %[[decl:.*]]:2 = hlfir.declare %[[addr]](%[[shape_decl]]) typeparams %[[len]] {{.*}}
print *, c
! CHECK: fir.call @_FortranAioBeginExternalListOutput
- ! CHECK: fir.shape %[[dims1]]#1, %[[dims2]]#1
+ ! CHECK: %[[shape:.*]] = fir.shape %[[dims1]]#1, %[[dims2]]#1
+ ! CHECK: fir.embox %[[decl]]#1(%[[shape]]) typeparams %[[len]]
end subroutine
diff --git a/flang/test/Lower/assumed-type.f90 b/flang/test/Lower/assumed-type.f90
index 44ce41d757379..dfe358e9107f4 100644
--- a/flang/test/Lower/assumed-type.f90
+++ b/flang/test/Lower/assumed-type.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s
+! RUN: bbc -emit-hlfir %s -o - | FileCheck %s
module assumed_type_test
@@ -23,7 +23,8 @@ subroutine call_assumed()
! CHECK-LABEL: func.func @_QMassumed_type_testPcall_assumed() {
! CHECK: %[[I:.*]] = fir.alloca i32 {bindc_name = "i", fir.target, uniq_name = "_QMassumed_type_testFcall_assumedEi"}
-! CHECK: %[[CONV:.*]] = fir.convert %[[I]] : (!fir.ref<i32>) -> !fir.ref<none>
+! CHECK: %[[DECL:.*]]:2 = hlfir.declare %[[I]] {{.*}}
+! CHECK: %[[CONV:.*]] = fir.convert %[[DECL]]#0 : (!fir.ref<i32>) -> !fir.ref<none>
! CHECK: fir.call @_QPassumed(%[[CONV]]) {{.*}}: (!fir.ref<none>) -> ()
subroutine call_assumed_r()
@@ -33,7 +34,8 @@ subroutine call_assumed_r()
! CHECK-LABEL: func.func @_QMassumed_type_testPcall_assumed_r() {
! CHECK: %[[I:.*]] = fir.alloca !fir.array<10xi32> {bindc_name = "i", fir.target, uniq_name = "_QMassumed_type_testFcall_assumed_rEi"}
-! CHECK: %[[CONV:.*]] = fir.convert %[[I]] : (!fir.ref<!fir.array<10xi32>>) -> !fir.ref<!fir.array<?xnone>>
+! CHECK: %[[DECL:.*]]:2 = hlfir.declare %[[I]]{{.*}}
+! CHECK: %[[CONV:.*]] = fir.convert %[[DECL]]#0 : (!fir.ref<!fir.array<10xi32>>) -> !fir.ref<!fir.array<?xnone>>
! CHECK: fir.call @_QPassumed_r(%[[CONV]]) {{.*}} : (!fir.ref<!fir.array<?xnone>>) -> ()
subroutine assumed_type_optional_to_intrinsic(a)
@@ -43,7 +45,8 @@ subroutine assumed_type_optional_to_intrinsic(a)
! CHECK-LABEL: func.func @_QMassumed_type_testPassumed_type_optional_to_intrinsic(
! CHECK-SAME: %[[ARG0:.*]]: !fir.box<!fir.array<?xnone>> {fir.bindc_name = "a", fir.optional}) {
-! CHECK: %{{.*}} = fir.is_present %[[ARG0]] : (!fir.box<!fir.array<?xnone>>) -> i1
+! CHECK: %[[DECL:.*]]:2 = hlfir.declare %[[ARG0]] {{.*}}
+! CHECK: %{{.*}} = fir.is_present %[[DECL]]#1 : (!fir.box<!fir.array<?xnone>>) -> i1
subroutine assumed_type_lbound(a)
type(*), optional :: a(:,:)
diff --git a/flang/test/Lower/basic-call.f90 b/flang/test/Lower/basic-call.f90
index c1a9de3f72821..dd66493e9bf95 100644
--- a/flang/test/Lower/basic-call.f90
+++ b/flang/test/Lower/basic-call.f90
@@ -1,4 +1,4 @@
-! RUN: bbc %s -o "-" -emit-fir -hlfir=false | FileCheck %s
+! RUN: bbc %s -o "-" -emit-hlfir | FileCheck %s
subroutine sub1()
end
@@ -25,13 +25,9 @@ subroutine sub4()
end
! CHECK-LABEL: func @_QPsub4() {
-! CHECK-DAG: %[[REAL_VALUE:.*]] = fir.alloca f32 {adapt.valuebyref}
-! CHECK-DAG: %[[INT_VALUE:.*]] = fir.alloca i32 {adapt.valuebyref}
-! CHECK: %[[C2:.*]] = arith.constant 2 : i32
-! CHECK: fir.store %[[C2]] to %[[INT_VALUE]] : !fir.ref<i32>
-! CHECK: %[[C3:.*]] = arith.constant 3.000000e+00 : f32
-! CHECK: fir.store %[[C3]] to %[[REAL_VALUE]] : !fir.ref<f32>
-! CHECK: fir.call @_QPsub3(%[[INT_VALUE]], %[[REAL_VALUE]]) {{.*}}: (!fir.ref<i32>, !fir.ref<f32>) -> ()
+! CHECK-DAG: %[[INT_VALUE:.*]]:3 = hlfir.associate %{{.*}} {adapt.valuebyref}
+! CHECK-DAG: %[[REAL_VALUE:.*]]:3 = hlfir.associate %{{.*}} {adapt.valuebyref}
+! CHECK: fir.call @_QPsub3(%[[INT_VALUE]]#0, %[[REAL_VALUE]]#0) {{.*}}: (!fir.ref<i32>, !fir.ref<f32>) -> ()
subroutine call_fct1()
real :: a, b, c
@@ -40,10 +36,13 @@ subroutine call_fct1()
! CHECK-LABEL: func @_QPcall_fct1()
! CHECK: %[[A:.*]] = fir.alloca f32 {bindc_name = "a", uniq_name = "_QFcall_fct1Ea"}
+! CHECK: %[[A_DECL:.*]]:2 = hlfir.declare %[[A]] {{.*}}
! CHECK: %[[B:.*]] = fir.alloca f32 {bindc_name = "b", uniq_name = "_QFcall_fct1Eb"}
+! CHECK: %[[B_DECL:.*]]:2 = hlfir.declare %[[B]] {{.*}}
! CHECK: %[[C:.*]] = fir.alloca f32 {bindc_name = "c", uniq_name = "_QFcall_fct1Ec"}
-! CHECK: %[[RES:.*]] = fir.call @_QPfct1(%[[A]], %[[B]]) {{.*}}: (!fir.ref<f32>, !fir.ref<f32>) -> f32
-! CHECK: fir.store %[[RES]] to %[[C]] : !fir.ref<f32>
+! CHECK: %[[C_DECL:.*]]:2 = hlfir.declare %[[C]] {{.*}}
+! CHECK: %[[RES:.*]] = fir.call @_QPfct1(%[[A_DECL]]#0, %[[B_DECL]]#0) {{.*}}: (!fir.ref<f32>, !fir.ref<f32>) -> f32
+! CHECK: hlfir.assign %[[RES]] to %[[C_DECL]]#0 : f32, !fir.ref<f32>
! CHECK: return
! CHECK: func private @_QPfct1(!fir.ref<f32>, !fir.ref<f32>) -> f32
More information about the flang-commits
mailing list