[flang] Use CHECK-DAG to check constants (NFC) - #183687
Merged
linuxlonelyeagle merged 1 commit intoFeb 27, 2026
Merged
Conversation
linuxlonelyeagle
requested review from
jeanPerier and
luporl
and removed request for
jeanPerier
February 27, 2026 06:03
Member
|
@llvm/pr-subscribers-flang-fir-hlfir Author: lonely eagle (linuxlonelyeagle) ChangesIt is part of #180556, as a separate NFC PR Full diff: https://github.com/llvm/llvm-project/pull/183687.diff 2 Files Affected:
diff --git a/flang/test/Lower/HLFIR/goto-do-body.f90 b/flang/test/Lower/HLFIR/goto-do-body.f90
index 45e4ef66ab639..05b666919c4c7 100644
--- a/flang/test/Lower/HLFIR/goto-do-body.f90
+++ b/flang/test/Lower/HLFIR/goto-do-body.f90
@@ -6,9 +6,9 @@ subroutine sub1()
implicit none
integer :: i
external foo
-! CHECK: %[[C2:.*]] = arith.constant 2 : i32
-! CHECK: %[[C0:.*]] = arith.constant 0 : i32
-! CHECK: %[[C1:.*]] = arith.constant 1 : i32
+! CHECK-DAG: %[[C2:.*]] = arith.constant 2 : i32
+! CHECK-DAG: %[[C0:.*]] = arith.constant 0 : i32
+! CHECK-DAG: %[[C1:.*]] = arith.constant 1 : i32
! CHECK: %[[TRIP:.*]] = fir.alloca i32
! CHECK: %[[I_REF:.*]] = fir.alloca i32 {bindc_name = "i", {{.*}}}
! CHECK: %[[I:.*]]:2 = hlfir.declare %[[I_REF]] {uniq_name = "_QFsub1Ei"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)
diff --git a/flang/test/Lower/volatile3.f90 b/flang/test/Lower/volatile3.f90
index d5eaa8ee8f752..06bcbfeee42fa 100644
--- a/flang/test/Lower/volatile3.f90
+++ b/flang/test/Lower/volatile3.f90
@@ -237,10 +237,10 @@ subroutine sub_select_rank(arr)
! CHECK-LABEL: func.func private @_QFPsub_select_rank(
! CHECK-SAME: %[[ARG0:.*]]: !fir.box<!fir.array<*:i32>> {fir.bindc_name = "arr"}) {{.*}} {
-! CHECK: %[[CONSTANT_0:.*]] = arith.constant 1 : index
-! CHECK: %[[CONSTANT_1:.*]] = arith.constant 5 : i32
-! CHECK: %[[CONSTANT_2:.*]] = arith.constant 4 : i8
-! CHECK: %[[CONSTANT_3:.*]] = arith.constant 1 : i8
+! CHECK-DAG: %[[CONSTANT_0:.*]] = arith.constant 1 : index
+! CHECK-DAG: %[[CONSTANT_1:.*]] = arith.constant 5 : i32
+! CHECK-DAG: %[[CONSTANT_2:.*]] = arith.constant 4 : i8
+! CHECK-DAG: %[[CONSTANT_3:.*]] = arith.constant 1 : i8
! CHECK: %[[DUMMY_SCOPE_0:.*]] = fir.dummy_scope : !fir.dscope
! CHECK: %[[VOLATILE_CAST_0:.*]] = fir.volatile_cast %[[ARG0]] : (!fir.box<!fir.array<*:i32>>) -> !fir.box<!fir.array<*:i32>, volatile>
! CHECK: %[[DECLARE_0:.*]]:2 = hlfir.declare %[[VOLATILE_CAST_0]] dummy_scope %[[DUMMY_SCOPE_0]] arg 1 {fortran_attrs = #fir.var_attrs<volatile>, uniq_name = "_QFFsub_select_rankEarr"} : (!fir.box<!fir.array<*:i32>, volatile>, !fir.dscope) -> (!fir.box<!fir.array<*:i32>, volatile>, !fir.box<!fir.array<*:i32>, volatile>)
|
Member
Author
|
@eugeneepshteyn Thank you help review the code. |
sujianIBM
pushed a commit
to sujianIBM/llvm-project
that referenced
this pull request
Mar 5, 2026
It is part of llvm#180556, as a separate NFC PR
This was referenced Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It is part of #180556, as a separate NFC PR