All checks were successful
Gajumaru Bytecode Tests / tests (push) Successful in -3m34s
Add Gitea tests Rename Remove oracle references Package for zx Reviewed-on: #235 Reviewed-by: dimitar.p.ivanov <dimitarivanov@qpq.swiss> Co-authored-by: Craig Everett <zxq9@zxq9.com> Co-committed-by: Craig Everett <zxq9@zxq9.com>
42 lines
835 B
Plaintext
42 lines
835 B
Plaintext
;; CONTRACT: Test
|
|
FUNCTION id(integer) -> integer
|
|
RETURN
|
|
|
|
FUNCTION jumps() -> integer
|
|
PUSH 0
|
|
JUMP 3
|
|
NOP
|
|
JUMP 2
|
|
NOP
|
|
RETURN
|
|
NOP
|
|
JUMP 1
|
|
|
|
FUNCTION inc(integer) -> integer
|
|
INCA
|
|
INCA
|
|
RETURN
|
|
|
|
FUNCTION call(integer) -> integer
|
|
INCA
|
|
CALL "inc"
|
|
INCA
|
|
RETURN
|
|
|
|
|
|
FUNCTION tailcall(integer) -> integer
|
|
INCA
|
|
CALL_T "inc"
|
|
|
|
;; FUNCTION remote_call(integer) : integer
|
|
;; PUSH arg0
|
|
;; CALL_R remote.add_five {tuple, [integer]} integer 0 ;; typereps don't parse
|
|
;; INCA
|
|
;; RETURN
|
|
|
|
;; Test the code from the shell
|
|
;; _build/default/rel/aessembler/bin/aessembler console
|
|
|
|
;; gmb_gmfa:file("../../../../test/asm_code/test.fate", []).
|
|
;; f(Asm), f(Env), f(BC), Asm = gmfa_asm:read_file("../../../../test/asm_code/test.fate"), {Env, BC} = gmfa_asm:asm_to_bytecode(Asm, []), gmfa_asm:bytecode_to_fate_code(BC, []).
|