Files
2026-10-17 21:57:03 +08:00

26 lines
903 B
Plaintext

import testcheck
# Extern2Test - minimal repro: ExternalDecl/StateDecl redefinition
# Three declarations plus main; each must emit exactly one declare.
extern def ExternalDecl(x: int) -> int
extern def StateDecl(x: int) -> int
extern def StateVoidDecl()
def test_extern_decl():
"""Verify the three extern declarations emit declare only once."""
testcheck.section("Extern/State declarations (no duplicate)")
# External declarations are not called; the linker resolves the symbols.
testcheck.check(True, "ExternalDecl declared (not called)", "expect declared once")
testcheck.check(True, "StateDecl declared (not called)", "expect declared once")
testcheck.check(True, "StateVoidDecl declared (not called)", "expect declared once")
def main() -> int:
testcheck.begin("Extern2Test: minimal repro - extern redefinition")
test_extern_decl()
return testcheck.end()