Draft specification, RFCs, reference registries and examples, plus the reference-implementation skeleton: build.zig, diagnostic envelope with error-code registry synced to docs, aji CLI, conformance runner with seed tests, CI and contributor docs.
23 lines
423 B
LLVM
23 lines
423 B
LLVM
; Counting loop passing state through block parameters instead of phi nodes.
|
|
; expect: accept
|
|
; phase: 0
|
|
; spec: docs/spec/07-air.md
|
|
fn @count(%n: u64) -> u64
|
|
effects []
|
|
|
|
entry:
|
|
%zero = const.u64 0
|
|
br @loop(%zero)
|
|
|
|
loop(%i: u64):
|
|
%done = ge.u64 %i, %n
|
|
cbr %done, @exit(%i), @body(%i)
|
|
|
|
body(%j: u64):
|
|
%one = const.u64 1
|
|
%next = add.checked.u64 %j, %one
|
|
br @loop(%next)
|
|
|
|
exit(%r: u64):
|
|
ret %r
|