- src/interp/machine.zig: format-0 interpreter on the air64 target; checked/wrapping arithmetic, shifts, casts, aggregates, calls with a 1024-frame limit, traps as records with T0xxx codes - aji run: prints one JSON run record; exit code 4 on trap - conformance runner: `expect: run` with `result:`/`trap:`, every run executed twice and compared byte-for-byte; header keys must be single lowercase words - Phase 0 corpus: 3 accept, 19 reject, 15 run tests (41 total)
22 lines
516 B
LLVM
22 lines
516 B
LLVM
; Structs and enums are rendered in the run record.
|
|
; expect: run
|
|
; result: {"variant":"Err","payload":[{"code":404,"fatal":false}]}
|
|
; phase: 0
|
|
; spec: docs/spec/07a-air-instructions.md
|
|
module test.aggregates
|
|
air 0
|
|
lang 0.1
|
|
features []
|
|
|
|
type @Error = struct { code: u16, fatal: bool }
|
|
type @Result = enum { Ok(u32), Err(@Error) }
|
|
|
|
fn @main() -> @Result
|
|
effects []
|
|
entry:
|
|
%code = const.u16 404
|
|
%fatal = const.bool false
|
|
%e = struct.make @Error(%code, %fatal)
|
|
%r = enum.make @Result.Err(%e)
|
|
ret %r
|