27 lines
431 B
LLVM
27 lines
431 B
LLVM
; expect: run
|
|
; result: 7
|
|
; phase: 0
|
|
; spec: docs/spec/07a-air-instructions.md; docs/spec/16-standard-library.md
|
|
module test.minimum
|
|
air 0
|
|
lang 0.1
|
|
features [effects]
|
|
|
|
fn @main() -> u64
|
|
effects []
|
|
entry:
|
|
%a = const.u64 7
|
|
%b = const.u64 11
|
|
%v = call @min(%a, %b)
|
|
ret %v
|
|
|
|
fn @min(%a: u64, %b: u64) -> u64
|
|
effects []
|
|
entry:
|
|
%less = lt.u64 %a, %b
|
|
cbr %less, @left(), @right()
|
|
left:
|
|
ret %a
|
|
right:
|
|
ret %b
|