[flang-commits] [flang] 1a6bd39 - [flang] Use CHECK-DAG to check constants (NFC) (#183687)

via flang-commits flang-commits at lists.llvm.org
Fri Feb 27 03:17:08 PST 2026


Author: lonely eagle
Date: 2026-02-27T19:17:03+08:00
New Revision: 1a6bd39fd49868c5024db908cc194397f3415029

URL: https://github.com/llvm/llvm-project/commit/1a6bd39fd49868c5024db908cc194397f3415029
DIFF: https://github.com/llvm/llvm-project/commit/1a6bd39fd49868c5024db908cc194397f3415029.diff

LOG: [flang] Use CHECK-DAG to check constants (NFC) (#183687)

It is part of https://github.com/llvm/llvm-project/pull/180556, as a
separate NFC PR

Added: 
    

Modified: 
    flang/test/Lower/HLFIR/goto-do-body.f90
    flang/test/Lower/volatile3.f90

Removed: 
    


################################################################################
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>)


        


More information about the flang-commits mailing list