From 384fccd8b879dfc906bd07524f7449c928ebef25 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Mon, 12 Oct 2026 20:35:55 +0800 Subject: [PATCH] =?UTF-8?q?test(llvmlitest):=20=E6=A8=A1=E5=9D=97=E5=A4=B4?= =?UTF-8?q?=E6=96=AD=E8=A8=80=E8=BF=81=E7=A7=BB=E5=88=B0=20llvm.target=5Ft?= =?UTF-8?q?riple/data=5Flayout=20=E5=B1=9E=E6=80=A7=E5=8F=A3=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LLvmLiteTest/App/main.vp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/LLvmLiteTest/App/main.vp b/LLvmLiteTest/App/main.vp index c5a6eef..ceca89f 100644 --- a/LLvmLiteTest/App/main.vp +++ b/LLvmLiteTest/App/main.vp @@ -222,13 +222,14 @@ def test_module_print(pool: memhub.MemBuddy*): mcore.PrintModule(buf, 8192, mod) testcheck.info(buf) - # verify key content - testcheck.check(string.strstr(buf, "module {") is not None, - "contains 'module {'", - "missing 'module {'") - testcheck.check(string.strstr(buf, "target triple") is not None, - "contains 'target triple'(MLIR 只在注释里标注)", - "missing 'target triple'") + # verify key content(模块头:triple / data layout 以 llvm.* 模块属性承载, + # 见 mlirlite/__module.vp;mlir-translate 会把它映射回 LLVM IR 的 target triple / target 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")