tests: the full suite's seven failures on lang/foundations - one compiler fault and six stale expectations
- the test runner re-makes every state between tests again: since12fdc07a state is made by its getter on first use, so re-running L_init_globals left the last test's state in place (state/tested failed its second test); @L_reset_states forgets every lazy state, and the runner calls it before each test - diag_json_case counts errors, and an absent @Ref / @Tint / @OneOf target is a warning sinced82dc31: ref_unknown is 1 error and node_bad 8 - schema_hash.ludic prints 1: a bool is 1 or 0 as text (random_plain's 1 1 1) - permap_check_case looks for the unit warning without the quotes the JSON escapes - baked_test's inputs-hash test makes its directory: each test has a temp directory of its own - ludic deps prints phase 25's five counters too Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
9ff219d065
commit
d8baf4e579
7 changed files with 57785 additions and 57592 deletions
|
|
@ -113,6 +113,7 @@ function emit_test_fn(t: Node, idx: int) -> void {
|
|||
# emit every test body plus the runner @main that drives them.
|
||||
function emit_test_runner() -> void {
|
||||
emith("@L_test_fail = internal global i32 0\n")
|
||||
emit_state_reset()
|
||||
emith("@.fmt_test_sum = private unnamed_addr constant [28 x i8] c\"== %d passed, %d failed ==\\0A\\00\"\n")
|
||||
emith("@.fmt_test_none = private unnamed_addr constant [20 x i8] c\"no test named \\22%s\\22\\0A\\00\"\n")
|
||||
var i = 0
|
||||
|
|
@ -181,7 +182,10 @@ function emit_test_runner() -> void {
|
|||
emit(` store i32 {rn1}, ptr %ran\n`)
|
||||
emit(" store i32 0, ptr @L_test_fail\n")
|
||||
# 0.S: every state fresh for each test - the states are what changes, and they are made here
|
||||
if i > 0 { emit(" call void @L_init_globals()\n") }
|
||||
if i > 0 {
|
||||
emit(" call void @L_init_globals()\n")
|
||||
emit(" call void @L_reset_states()\n") # a lazy state is made by its getter, not above
|
||||
}
|
||||
emit(` call void @fn__test_{itoa(i)}()\n`)
|
||||
let f = emit_bind("load i32, ptr @L_test_fail")
|
||||
let isbad = emit_bind(`icmp ne i32 {f}, 0`)
|
||||
|
|
|
|||
|
|
@ -43,6 +43,18 @@ function emit_state_getter(d: Node) -> void {
|
|||
emit("}\n\n")
|
||||
}
|
||||
|
||||
# the test runner's fresh start between tests: every lazy state forgotten, so its getter makes it
|
||||
# anew from its defaults (0.S: each test's states are fresh) - L_init_globals no longer makes them
|
||||
function emit_state_reset() -> void {
|
||||
emith("define void @L_reset_states() {\nentry:\n")
|
||||
var i = 0
|
||||
while i < len(prog) {
|
||||
if is_lazy_state(prog[i]) { emith(` store ptr null, ptr @g_{prog[i].s}\n`) }
|
||||
i += 1
|
||||
}
|
||||
emith(" ret void\n}\n")
|
||||
}
|
||||
|
||||
# a read of a state global: its getter's answer, or null when it is not lazy
|
||||
function lazy_state_read(g: Node, s: pointer) -> pointer {
|
||||
if not is_lazy_state(g) { return null }
|
||||
|
|
|
|||
56391
selfhost/ludicc.seed.ll
56391
selfhost/ludicc.seed.ll
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue