blaise/vendor/qbe/test/double.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

26 lines
407 B
Plaintext

export
function $test() {
@start
%x1 =d copy d_0.1
%x2 =d add d_0.2, %x1
%x3 =d sub %x2, d_0.3
@loop
%x4 =d phi @start %x3, @loop %x5
%i1 =w phi @start 0, @loop %i2
%x5 =d add %x4, %x4
%i2 =w add %i1, 1
%c0 =w cled %x5, 4607182418800017408 # d_1.0
jnz %c0, @loop, @end
@end
storew %i2, $a
ret
}
# >>> driver
# extern void test(void);
# int a;
# int main() { test(); return !(a == 55); }
# <<<