[Mlir-commits] [mlir] [mlir][toy] Fix Ch6/Ch7 llvm-lowering tests (PR #212118)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sun Jul 26 06:48:11 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: Felix Ye (yanjs)

<details>
<summary>Changes</summary>

Add missing `| FileCheck %s` to `RUN` lines so `CHECK` lines can be verified. Also correct the expected result from `30` to `36`. The result should be `6*6=36`.

---
Full diff: https://github.com/llvm/llvm-project/pull/212118.diff


2 Files Affected:

- (modified) mlir/test/Examples/Toy/Ch6/llvm-lowering.mlir (+2-2) 
- (modified) mlir/test/Examples/Toy/Ch7/llvm-lowering.mlir (+2-2) 


``````````diff
diff --git a/mlir/test/Examples/Toy/Ch6/llvm-lowering.mlir b/mlir/test/Examples/Toy/Ch6/llvm-lowering.mlir
index 37ad2bd808a53..8e2f82cf15c5c 100644
--- a/mlir/test/Examples/Toy/Ch6/llvm-lowering.mlir
+++ b/mlir/test/Examples/Toy/Ch6/llvm-lowering.mlir
@@ -1,4 +1,4 @@
-// RUN: toyc-ch6 %s -emit=llvm -opt
+// RUN: toyc-ch6 %s -emit=llvm -opt 2>&1 | FileCheck %s
 
 toy.func @main() {
   %0 = toy.constant dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>
@@ -20,4 +20,4 @@ toy.func @main() {
 // CHECK: @printf
 // CHECK-SAME: 9.000000e+00
 // CHECK: @printf
-// CHECK-SAME: 3.000000e+01
+// CHECK-SAME: 3.600000e+01
diff --git a/mlir/test/Examples/Toy/Ch7/llvm-lowering.mlir b/mlir/test/Examples/Toy/Ch7/llvm-lowering.mlir
index fc4c8d5019355..b4d25393b4ef0 100644
--- a/mlir/test/Examples/Toy/Ch7/llvm-lowering.mlir
+++ b/mlir/test/Examples/Toy/Ch7/llvm-lowering.mlir
@@ -1,4 +1,4 @@
-// RUN: toyc-ch7 %s -emit=llvm -opt
+// RUN: toyc-ch7 %s -emit=llvm -opt 2>&1 | FileCheck %s
 
 toy.func @main() {
   %0 = toy.constant dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>
@@ -20,4 +20,4 @@ toy.func @main() {
 // CHECK: @printf
 // CHECK-SAME: 9.000000e+00
 // CHECK: @printf
-// CHECK-SAME: 3.000000e+01
+// CHECK-SAME: 3.600000e+01

``````````

</details>


https://github.com/llvm/llvm-project/pull/212118


More information about the Mlir-commits mailing list