chore: 更新 TODO/toast 脚本/测试源
TODO 补编译器实验方向;toast 通知改 list 泛型方法修复完成;DecoratorTest 补 global _call_count 声明;LLvmLiteTest ConstFloat 断言改十六进制位模式。
This commit is contained in:
1 parent
2b074dfb48
commit
3fe985648e
4 files changed
+17
-7
No files matched your search
@@ -283,6 +283,7 @@ def main() -> t.CInt | t.CExport:
|
||||
|
||||
# 测试 10:递归装饰保护 — @count_calls
|
||||
testcheck.section("Test 10: recursive decoration protection")
|
||||
global _call_count
|
||||
_call_count = 0
|
||||
r10: t.CInt = factorial(5)
|
||||
printf("factorial(5) = %d (should be 120)\n", r10)
|
||||
|
||||
@@ -445,16 +445,17 @@ def test_float_types(pool: memhub.MemPool | t.CPtr):
|
||||
"FP128 -> fp128",
|
||||
"FP128 fail")
|
||||
|
||||
# ConstFloat(3.14) -> "double 3.140000e+00"
|
||||
# ConstFloat(3.14) -> "double 0x40091EB851EB851F"
|
||||
# (LLVM IR 浮点常量规范为十六进制位模式,非科学计数法;位模式无精度损失)
|
||||
val_pi: llvmlite.Value | t.CPtr = mcore.ConstFloat(ty_double, 3.14)
|
||||
buf[0] = 0
|
||||
mcore.PrintValue(buf, 128, val_pi)
|
||||
testcheck.check(string.strstr(buf, "double") is not None,
|
||||
"ConstFloat has 'double'",
|
||||
"ConstFloat missing type")
|
||||
testcheck.check(string.strstr(buf, "e+") is not None or string.strstr(buf, "e-") is not None,
|
||||
"ConstFloat has scientific notation",
|
||||
"ConstFloat missing sci notation")
|
||||
testcheck.check(string.strstr(buf, "0x") is not None,
|
||||
"ConstFloat has hex bit pattern",
|
||||
"ConstFloat missing hex pattern")
|
||||
|
||||
|
||||
# ============================================================
|
||||
|
||||
Reference in new issue
Block a user