interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / tests / compiler / progs / calls.osc

17 lines · 680 bytes Raw Blame History
1// entry: c0 c6 call_all
2// calls with 0..6 scalar parameters.
3fn c0() -> i64 { return 42; }
4fn c1(a: i64) -> i64 { return a + c0(); }
5fn c2(a: i64, b: i32) -> i64 { return c1(a) - (b as i64); }
6fn c3(a: i64, b: i32, c: u8) -> i64 { return c2(a, b) * (c as i64); }
7fn c4(a: i64, b: i32, c: u8, d: bool) -> i64 {
8 if d { return c3(a, b, c); }
9 return c3(a, b, c) + 1;
10}
11fn c5(a: i64, b: i32, c: u8, d: bool, e: u16) -> i64 { return c4(a, b, c, d) ^ (e as i64); }
12fn c6(a: i64, b: i32, c: u8, d: bool, e: u16, f: i8) -> i64 { return c5(a, b, c, d, e) + (f as i64); }
13fn noop() { }
14fn call_all(x: i32) -> i64 {
15 noop();
16 return c6(x as i64, x, 3, x > 0, 7, -1) + c0();
17}