blaise/vendor/qbe/test/ldbits.ssa
Graeme Geldenhuys 25de8be212 Fix compilation errors; vendor QBE 1.2; end-to-end Hello World works
Fix TProgram.Uses reserved-word clash (renamed to UsedUnits), nested
brace-comment in uParser.pas, and missing uAST in Blaise.pas uses clause.

Vendor QBE 1.2 source in vendor/qbe/ (built locally with make; binary
excluded via .gitignore). End-to-end pipeline confirmed: Blaise compiles
Hello World and Calc (6*7=42) to native x86_64 Linux binaries.

71/71 FPCUnit tests passing.
2026-04-20 16:38:57 +01:00

41 lines
637 B
Plaintext

# unit tests for load elimination
export
function $tests() {
@start
%p =l alloc8 16
%p3 =l add %p, 3
%p4 =l add %p, 4
%p6 =l add %p, 6
%p8 =l add %p, 8
@test1
storew 1, $a
storel 1311768467139281697, %p
storeh 255, %p8
%x1 =w load %p6
%c1 =w cnew %x1, 16716340
jnz %c1, @fail, @test2
@test2
storew 2, $a
%x2 =w loadub %p3
%c2 =w cnew %x2, 135
jnz %c2, @fail, @test3
@test3
storew 3, $a
storew 2864434397, %p8
%x3 =l load %p3
%c3 =w cnel %x3, -4914310023110821753
jnz %c3, @fail, @test4
@test4
@ok
storew 0, $a
@fail
ret
}
# >>> driver
# extern void tests(void);
# int a;
# int main() { tests(); return a; }
# <<<