test(llvmlitest): 模块头断言迁移到 llvm.target_triple/data_layout 属性口径

This commit is contained in:
TermiNexus committed 2026-10-12 20:35:55 +08:00
1 parent 735f5d49af
commit 384fccd8b8
1 file changed
+8 -7
+8 -7
View File
@@ -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")