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")