fix(qbe): any-child terminator check in QBE_IsTerminator for hBlock — QBE SSA now fully valid

- QBE_IsTerminator(hBlock) checks ALL children, not just last
- Removed legacy c_backend.bux and nim_backend.bux from _selfhost/src/
- QBE self-hosting QBE phase: PASSES (SSA valid, assembled to .s)
- Remaining: linker errors from missing String_Eq/StringBuilder in runtime
This commit is contained in:
2026-06-02 13:56:12 +03:00
parent 6cb5528a4d
commit eb8179b6d0
142 changed files with 70706 additions and 1407 deletions
+50
View File
@@ -0,0 +1,50 @@
# regression test for load()
# see comment below
function w $rand() {
@start
ret 0
}
function w $chk(w %a, w %b) {
@start
%ok =w ceqw %a, 1
%ok1 =w ceqw %b, 0
%ok2 =w and %ok, %ok1
%ret =w xor %ok2, 1
ret %ret
}
export
function w $main() {
@start
%s0 =l alloc4 8
%s1 =l alloc4 8
storew 1, %s0
%s04 =l add 4, %s0
storew 0, %s04
%rnd =w call $rand()
jnz %rnd, @tt, @ff
@tt
jmp @blit
@ff
jmp @blit
@blit
# we make sure def() checks
# offsets correctly when
# processing inserted phis;
# if not, %w1 will bogusly
# have the same value as %w0
blit %s0, %s1, 8
%w0 =w load %s1
%s14 =l add 4, %s1
%w1 =w load %s14
%ret =w call $chk(w %w0, w %w1)
ret %ret
}