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

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Jul 29 05:05:55 PDT 2026


Author: Felix Ye
Date: 2026-07-29T20:05:50+08:00
New Revision: d630025295d5ef6724ec9deab162b983ffee6638

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

LOG: [mlir][toy] Fix Ch6/Ch7 llvm-lowering tests (#212118)

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`.

The example in the tutorial is correct (`3.600000e+01`).
https://mlir.llvm.org/docs/Tutorials/Toy/Ch-6/

Signed-off-by: Felix Ye <felixyjs at gmail.com>

Added: 
    

Modified: 
    mlir/test/Examples/Toy/Ch6/llvm-lowering.mlir
    mlir/test/Examples/Toy/Ch7/llvm-lowering.mlir

Removed: 
    


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


        


More information about the Mlir-commits mailing list