From 298e694700adc80231fa906efe8055acd0b210c0 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Tue, 13 Oct 2026 10:24:40 +0800 Subject: [PATCH] =?UTF-8?q?test(mlirlitetest):=20=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E5=A4=B4=E6=96=AD=E8=A8=80=E8=BF=81=E7=A7=BB=E5=88=B0=20llvm.t?= =?UTF-8?q?arget=5Ftriple/data=5Flayout=20=E5=B1=9E=E6=80=A7=E5=8F=A3?= =?UTF-8?q?=E5=BE=84=EF=BC=88=E4=B8=8E=20LLvmLiteTest=20=E5=AF=B9=E9=BD=90?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MLIRLiteTest/App/main.vp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/MLIRLiteTest/App/main.vp b/MLIRLiteTest/App/main.vp index 1bc985c..bd110b7 100644 --- a/MLIRLiteTest/App/main.vp +++ b/MLIRLiteTest/App/main.vp @@ -354,9 +354,14 @@ def test_module_print(pool: memhub.MemBuddy*): testcheck.info(buf) dump_mlir(pool, "T06_module.mlir", buf) - testcheck.check(string.strstr(buf, "module {") is not None, - "contains 'module {'", - "missing 'module {'") + # 模块头:triple / data layout 以 llvm.* 模块属性承载(见 mlirlite/__module.vp)。设了 target 之后 + # 就不再是裸 `module {`——mlir-translate 会把这两个属性映射回 LLVM IR 的 target triple / datalayout。 + testcheck.check(string.strstr(buf, "module attributes {llvm.target_triple = \"x86_64-pc-windows-gnu\"") is not None, + "contains 'module attributes {llvm.target_triple = \"x86_64-pc-windows-gnu\"'", + "missing 'module attributes {llvm.target_triple ...'") + testcheck.check(string.strstr(buf, "llvm.data_layout = \"e-m:w-p270:32:32\"") is not None, + "contains 'llvm.data_layout = \"e-m:w-p270:32:32\"'", + "missing 'llvm.data_layout = ...'") testcheck.check(string.strstr(buf, "llvm.func @add") is not None, "contains 'llvm.func @add'", "missing add function")