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

Felix Ye llvmlistbot at llvm.org
Sun Jul 26 06:47:14 PDT 2026


https://github.com/yanjs created https://github.com/llvm/llvm-project/pull/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`.

>From 8586bddd0ced5ccdc5ccfb38f08afbeb4d09f920 Mon Sep 17 00:00:00 2001
From: Felix Ye <felixyjs at gmail.com>
Date: Sun, 26 Jul 2026 21:10:10 +0800
Subject: [PATCH] [mlir][toy] Fix Ch6/Ch7 llvm-lowering tests

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

Signed-off-by: Felix Ye <felixyjs at gmail.com>
---
 mlir/test/Examples/Toy/Ch6/llvm-lowering.mlir | 4 ++--
 mlir/test/Examples/Toy/Ch7/llvm-lowering.mlir | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

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