test(llvmlitest): 模块头断言迁移到 llvm.target_triple/data_layout 属性口径
This commit is contained in:
1 parent
735f5d49af
commit
384fccd8b8
1 file changed
+8
-7
@@ -222,13 +222,14 @@ def test_module_print(pool: memhub.MemBuddy*):
|
|||||||
mcore.PrintModule(buf, 8192, mod)
|
mcore.PrintModule(buf, 8192, mod)
|
||||||
testcheck.info(buf)
|
testcheck.info(buf)
|
||||||
|
|
||||||
# verify key content
|
# verify key content(模块头:triple / data layout 以 llvm.* 模块属性承载,
|
||||||
testcheck.check(string.strstr(buf, "module {") is not None,
|
# 见 mlirlite/__module.vp;mlir-translate 会把它映射回 LLVM IR 的 target triple / target datalayout)
|
||||||
"contains 'module {'",
|
testcheck.check(string.strstr(buf, "module attributes {llvm.target_triple = \"x86_64-pc-windows-gnu\"") is not None,
|
||||||
"missing 'module {'")
|
"contains 'module attributes {llvm.target_triple = \"x86_64-pc-windows-gnu\"'",
|
||||||
testcheck.check(string.strstr(buf, "target triple") is not None,
|
"missing 'module attributes {llvm.target_triple ...'")
|
||||||
"contains 'target triple'(MLIR 只在注释里标注)",
|
testcheck.check(string.strstr(buf, "llvm.data_layout = \"e-m:w-p270:32:32\"") is not None,
|
||||||
"missing 'target triple'")
|
"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,
|
testcheck.check(string.strstr(buf, "llvm.func @add") is not None,
|
||||||
"contains 'llvm.func @add'",
|
"contains 'llvm.func @add'",
|
||||||
"missing add function")
|
"missing add function")
|
||||||
|
|||||||
Reference in new issue
Block a user