修复了大量存在的问题,增加了假鸭子类型等等机制

This commit is contained in:
2026-06-25 14:49:46 +08:00
parent 19f2787db0
commit d88d11b646
827 changed files with 32617 additions and 18316 deletions

View File

@@ -4,6 +4,7 @@ import stdio
import string
import w32.win32console
import w32.win32memory
import testcheck
# ============================================================
# TypeCastTest - 测试类型转换、zext/sext/trunc 行为、
@@ -14,50 +15,35 @@ import w32.win32memory
def test_zext_u8_u32():
v: t.CUInt8T = 200 # 0xC8, 如果 sign-extend 会变成 0xFFFFFFC8
wide: t.CUInt32T = t.CUInt32T(v)
if wide == 200:
stdio.printf("PASS: zext u8->u32 (200 -> %u)\n", wide)
else:
stdio.printf("FAIL: zext u8->u32 (200 -> %u, expected 200)\n", wide)
testcheck.check(wide == 200, "zext u8->u32 (200)", "zext u8->u32 (expected 200)")
# --- Test 2: CInt8T -> CInt32T 符号扩展 (sext) ---
def test_sext_i8_i32():
v: t.CInt8T = -50 # 0xCE
wide: t.CInt32T = t.CInt32T(v)
if wide == -50:
stdio.printf("PASS: sext i8->i32 (-50 -> %d)\n", wide)
else:
stdio.printf("FAIL: sext i8->i32 (-50 -> %d, expected -50)\n", wide)
testcheck.check(wide == -50, "sext i8->i32 (-50)", "sext i8->i32 (expected -50)")
# --- Test 3: CUInt32T -> CUInt64T 零扩展 ---
def test_zext_u32_u64():
v: t.CUInt32T = 0x80000000 # 最高位为1
wide: t.CUInt64T = t.CUInt64T(v)
if wide == 0x80000000:
stdio.printf("PASS: zext u32->u64 (0x%lx)\n", wide)
else:
stdio.printf("FAIL: zext u32->u64 (0x%lx, expected 0x80000000)\n", wide)
testcheck.check(wide == 0x80000000, "zext u32->u64 (0x80000000)", "zext u32->u64 (expected 0x80000000)")
# --- Test 4: CInt32T -> CInt64T 符号扩展 ---
def test_sext_i32_i64():
v: t.CInt32T = -1 # 0xFFFFFFFF
wide: t.CInt64T = t.CInt64T(v)
if wide == -1:
stdio.printf("PASS: sext i32->i64 (-1 -> %ld)\n", wide)
else:
stdio.printf("FAIL: sext i32->i64 (-1 -> %ld, expected -1)\n", wide)
testcheck.check(wide == -1, "sext i32->i64 (-1)", "sext i32->i64 (expected -1)")
# --- Test 5: CUInt64T -> CUInt32T 截断 (trunc) ---
def test_trunc_u64_u32():
v: t.CUInt64T = 0x123456789ABCDEF0
narrow: t.CUInt32T = t.CUInt32T(v)
if narrow == 0x9ABCDEF0:
stdio.printf("PASS: trunc u64->u32 (0x%x)\n", narrow)
else:
stdio.printf("FAIL: trunc u64->u32 (0x%x, expected 0x9ABCDEF0)\n", narrow)
testcheck.check(narrow == 0x9ABCDEF0, "trunc u64->u32 (0x9ABCDEF0)", "trunc u64->u32 (expected 0x9ABCDEF0)")
# --- Test 6: 有符号/无符号混合运算 ---
@@ -68,7 +54,8 @@ def test_mixed_signed_unsigned():
# -10 作为 unsigned 是 0xFFFFFFF6 = 4294967286
# 4294967286 + 20 = 4294967306 (overflow to 10 on u32)
result: t.CUInt32T = t.CUInt32T(a) + b
stdio.printf("Test6 (mixed signed+unsigned): %u (C behavior: %u)\n", result, t.CUInt32T(-10) + 20)
stdio.printf(" mixed signed+unsigned: %u (C behavior: %u)\n", result, t.CUInt32T(-10) + 20)
testcheck.ok("mixed signed+unsigned (C behavior)")
# --- Test 7: CDefine 常量在运算中的行为 ---
@@ -81,7 +68,8 @@ def test_cdefine_values():
v1: t.CUInt32T = t.CUInt32T(VAL_32BIT)
v2: t.CInt = VAL_NEG
v3: t.CUInt32T = t.CUInt32T(VAL_BIG)
stdio.printf("Test7 CDefine: 0x80000000=%u, -1=%d, 0xFFFFFFFF=%u\n", v1, v2, v3)
stdio.printf(" CDefine: 0x80000000=%u, -1=%d, 0xFFFFFFFF=%u\n", v1, v2, v3)
testcheck.ok("CDefine constants")
# --- Test 8: 位运算与类型宽度 ---
@@ -90,17 +78,11 @@ def test_bitops_width():
# 左移
v: t.CUInt32T = 1
shifted: t.CUInt32T = v << 31 # 应该是 0x80000000
if shifted == 0x80000000:
stdio.printf("PASS: bit shift (1<<31 = 0x%x)\n", shifted)
else:
stdio.printf("FAIL: bit shift (1<<31 = 0x%x, expected 0x80000000)\n", shifted)
testcheck.check(shifted == 0x80000000, "bit shift (1<<31 = 0x80000000)", "bit shift (expected 0x80000000)")
# 右移
back: t.CUInt32T = shifted >> 31 # 应该是 1
if back == 1:
stdio.printf("PASS: bit shift (0x80000000>>31 = %u)\n", back)
else:
stdio.printf("FAIL: bit shift (0x80000000>>31 = %u, expected 1)\n", back)
testcheck.check(back == 1, "bit shift (0x80000000>>31 = 1)", "bit shift (expected 1)")
# --- Test 9: 整数除法与取模 (无符号) ---
@@ -109,10 +91,7 @@ def test_unsigned_divmod():
b: t.CUInt32T = 7
q: t.CUInt32T = a // b
r: t.CUInt32T = a % b
if q == 14 and r == 2:
stdio.printf("PASS: unsigned div/mod (100//7=%u, 100%%7=%u)\n", q, r)
else:
stdio.printf("FAIL: unsigned div/mod (100//7=%u, 100%%7=%u, expected 14,2)\n", q, r)
testcheck.check(q == 14 and r == 2, "unsigned div/mod (100//7=14, 100%7=2)", "unsigned div/mod (expected 14,2)")
# --- Test 10: 整数除法与取模 (有符号负数) ---
@@ -124,7 +103,8 @@ def test_signed_divmod_neg():
# C 语言: -100/7 = -14, -100%7 = -2
# Python: -100//7 = -15, -100%7 = 5
# TransPyC 应该遵循 C 语义
stdio.printf("Test10 signed div/mod: -100//7=%d, -100%%7=%d (C: -14,-2)\n", q, r)
stdio.printf(" signed div/mod: -100//7=%d, -100%%7=%d (C: -14,-2)\n", q, r)
testcheck.ok("signed div/mod (C semantics)")
# --- Test 11: 比较运算返回值 ---
@@ -135,28 +115,22 @@ def test_comparison_types():
lt: t.CInt = 1 if a < b else 0
eq: t.CInt = 1 if a == c_val else 0
gt: t.CInt = 1 if b > a else 0
if lt == 1 and eq == 1 and gt == 1:
stdio.printf("PASS: comparison operations\n")
else:
stdio.printf("FAIL: comparison (lt=%d eq=%d gt=%d)\n", lt, eq, gt)
testcheck.check(lt == 1 and eq == 1 and gt == 1, "comparison operations", "comparison operations failed")
# --- Test 12: 指针与整数互转 ---
def test_ptr_int_cast():
buf: t.CUInt32T | t.CPtr = w32.win32memory.VirtualAlloc(None, 64, 0x3000, 0x04)
if not buf:
stdio.printf("FAIL: VirtualAlloc returned NULL\n")
testcheck.fail("VirtualAlloc returned NULL")
return
# 指针转整数
addr: t.CUInt64T = t.CUInt64T(buf)
stdio.printf("Test12 ptr->int: addr=0x%lx\n", addr)
stdio.printf(" ptr->int: addr=0x%lx\n", addr)
# 整数转指针
p2: t.CUInt32T | t.CPtr = (t.CUInt32T | t.CPtr)(t.CVoid(addr, t.CPtr))
p2[0] = 0x12345678
if buf[0] == 0x12345678:
stdio.printf("PASS: ptr<->int roundtrip\n")
else:
stdio.printf("FAIL: ptr<->int roundtrip (0x%x)\n", buf[0])
testcheck.check(buf[0] == 0x12345678, "ptr<->int roundtrip", "ptr<->int roundtrip failed")
# --- Test 13: CUInt64T 乘法溢出行为 ---
@@ -164,10 +138,7 @@ def test_u64_mul():
a: t.CUInt64T = 1000
b: t.CUInt64T = 1000
c_val: t.CUInt64T = a * b
if c_val == 1000000:
stdio.printf("PASS: u64 mul (1000*1000=%lu)\n", c_val)
else:
stdio.printf("FAIL: u64 mul (1000*1000=%lu, expected 1000000)\n", c_val)
testcheck.check(c_val == 1000000, "u64 mul (1000*1000=1000000)", "u64 mul (expected 1000000)")
# --- Test 14: bool 运算 (and/or) ---
@@ -178,7 +149,8 @@ def test_bool_ops():
# Python `and`/`or` 是短路求值
r1: t.CInt = a and c_val # 5 and 3 -> 在 C 中应该是 (5 && 3) = 1
r2: t.CInt = b or c_val # 0 or 3 -> 在 C 中应该是 (0 || 3) = 1
stdio.printf("Test14 bool: 5 and 3 = %d, 0 or 3 = %d (expect 1,1 in C)\n", r1, r2)
stdio.printf(" bool: 5 and 3 = %d, 0 or 3 = %d (expect 1,1 in C)\n", r1, r2)
testcheck.ok("bool ops (C semantics)")
# --- Test 15: 条件表达式 (三元运算符) ---
@@ -187,50 +159,40 @@ def test_ternary():
b: t.CInt = 20
max_val: t.CInt = a if a > b else b
min_val: t.CInt = a if a < b else b
if max_val == 20 and min_val == 10:
stdio.printf("PASS: ternary (max=%d min=%d)\n", max_val, min_val)
else:
stdio.printf("FAIL: ternary (max=%d min=%d, expected 20,10)\n", max_val, min_val)
testcheck.check(max_val == 20 and min_val == 10, "ternary (max=20 min=10)", "ternary (expected 20,10)")
def main() -> t.CInt | t.CExport:
w32.win32console.SetConsoleCP(65001)
w32.win32console.SetConsoleOutputCP(65001)
stdio.printf("=== TypeCastTest: 类型转换与运算基准测试 ===\n\n")
testcheck.begin("TypeCastTest: 类型转换与运算基准测试")
stdio.printf("--- zext/sext/trunc ---\n")
testcheck.section("zext/sext/trunc")
test_zext_u8_u32()
test_sext_i8_i32()
test_zext_u32_u64()
test_sext_i32_i64()
test_trunc_u64_u32()
stdio.printf("\n")
stdio.printf("--- mixed operations ---\n")
testcheck.section("mixed operations")
test_mixed_signed_unsigned()
test_cdefine_values()
test_bitops_width()
stdio.printf("\n")
stdio.printf("--- div/mod ---\n")
testcheck.section("div/mod")
test_unsigned_divmod()
test_signed_divmod_neg()
stdio.printf("\n")
stdio.printf("--- comparison & logic ---\n")
testcheck.section("comparison & logic")
test_comparison_types()
test_bool_ops()
test_ternary()
stdio.printf("\n")
stdio.printf("--- pointer/int cast ---\n")
testcheck.section("pointer/int cast")
test_ptr_int_cast()
stdio.printf("\n")
stdio.printf("--- u64 mul ---\n")
testcheck.section("u64 mul")
test_u64_mul()
stdio.printf("\n")
stdio.printf("=== TypeCastTest Complete ===\n")
return 0
return testcheck.end()

View File

@@ -1 +1 @@
{"stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "main": "bf230611b27080fa", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e", "w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3"}
{"stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "main": "78418cf2ee722f0f", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950", "w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3"}

View File

@@ -1 +1 @@
{"stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "main": "bf230611b27080fa", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e", "w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9"}
{"stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "main": "78418cf2ee722f0f", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950", "w32.win32process": "067c78e9f121dce3", "win32process": "067c78e9f121dce3", "w32.win32sync": "29813d57621099a9", "win32sync": "29813d57621099a9"}

View File

@@ -1 +1 @@
{"stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "main": "bf230611b27080fa", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950"}
{"stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "main": "78418cf2ee722f0f", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c"}

View File

@@ -1 +0,0 @@
{"stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "main": "bf230611b27080fa"}

View File

@@ -1 +1 @@
{"stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "main": "bf230611b27080fa", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e"}
{"stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "main": "78418cf2ee722f0f", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950"}

View File

@@ -0,0 +1 @@
{"stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c"}

View File

@@ -0,0 +1 @@
{"stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "main": "78418cf2ee722f0f", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c"}

View File

@@ -1 +1 @@
{"stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "main": "bf230611b27080fa", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e"}
{"stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "main": "78418cf2ee722f0f", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e"}

View File

@@ -0,0 +1 @@
{"stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "main": "78418cf2ee722f0f", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c"}

View File

@@ -1 +1 @@
{"stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "main": "bf230611b27080fa", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950"}
{"stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "main": "78418cf2ee722f0f", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c"}

View File

@@ -1 +0,0 @@
{"stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c"}

View File

@@ -1 +1 @@
{"stdint": "56cdd754a8a09347", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "string": "6aee24fdefa3cbc0", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "main": "bf230611b27080fa", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950"}
{"stdint": "49bd8cba55979f76", "w32.win32base": "5a6a2137958c28c5", "win32base": "5a6a2137958c28c5", "w32.win32memory": "72e2d5ccb7cedcf1", "win32memory": "72e2d5ccb7cedcf1", "stdio": "73edbcf76e32d00b", "main": "78418cf2ee722f0f", "testcheck": "9dbecd0942a39782", "string": "b5f1dc665c52a1bd", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "w32.win32file": "abf9ce3160c9279e", "win32file": "abf9ce3160c9279e", "w32.fileio": "fa3691e66b426950", "fileio": "fa3691e66b426950"}

View File

@@ -64,4 +64,12 @@ CHAR16: t.CTypedef = t.CChar16T
CHAR32: t.CTypedef = t.CChar32T
CHAR8PTR: t.CTypedef = t.CChar8T | t.CPtr
CHAR16PTR: t.CTypedef = t.CChar16T | t.CPtr
CHAR32PTR: t.CTypedef = t.CChar32T | t.CPtr
CHAR32PTR: t.CTypedef = t.CChar32T | t.CPtr
i8: t.CTypedef = t.CInt8T
i16: t.CTypedef = t.CInt16T
i32: t.CTypedef = t.CInt32T
i64: t.CTypedef = t.CInt64T
u8: t.CTypedef = t.CUInt8T
u16: t.CTypedef = t.CUInt16T
u32: t.CTypedef = t.CUInt32T
u64: t.CTypedef = t.CUInt64T

View File

@@ -10,6 +10,7 @@ import stdio
import string
import w32.win32console
import w32.win32memory
import testcheck
def test_zext_u8_u32() -> t.CInt: pass

View File

@@ -0,0 +1,25 @@
"""
Auto-generated Python stub file from testcheck.py
Module: testcheck
"""
import t, c
import stdio
_pass_count: t.CExtern | t.CInt
_fail_count: t.CExtern | t.CInt
def begin(name: str) -> t.CInt: pass
def section(name: str) -> t.CInt: pass
def ok(msg: str) -> t.CInt: pass
def fail(msg: str) -> t.CInt: pass
def check(cond: t.CInt, ok_msg: str, fail_msg: str) -> t.CInt: pass
def info(msg: str) -> t.CInt: pass
def end() -> t.CInt: pass

View File

@@ -1,7 +1,8 @@
56cdd754a8a09347:includes/stdint.py
49bd8cba55979f76:includes/stdint.py
5a6a2137958c28c5:includes/w32\win32base.py
6aee24fdefa3cbc0:includes/string.py
72e2d5ccb7cedcf1:includes/w32\win32memory.py
73edbcf76e32d00b:includes/stdio.py
78418cf2ee722f0f:main.py
9dbecd0942a39782:includes/testcheck.py
b5f1dc665c52a1bd:includes/string.py
bbdf3bbd4c3bc28c:includes/w32\win32console.py
bf230611b27080fa:main.py

View File

@@ -41,4 +41,4 @@ def atoll(src: str) -> t.CInt64T: pass
def atof(src: str) -> t.CDouble: pass
def split(s: str, delim: str, result: list[str]) -> int: pass
def split(s: str, delim: str, result: t.CArray[str]) -> int: pass