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
omega-mv / tests / compiler / progs / sixparams.osc
| 1 | // entry: six_main |
| 2 | // a callee with 6 mixed parameters: own, &, &mut and scalars. |
| 3 | fn mix6(o: own [u8; 4], s: &[u8; 4], m: &mut [u8; 4], a: u8, b: i64, c: bool) -> i64 { |
| 4 | m[0] = o[1] + s[2] + a; |
| 5 | let mut r: i64 = (m[0] as i64) + b; |
| 6 | if c { r = r - (s[3] as i64); } |
| 7 | return r; |
| 8 | } |
| 9 | |
| 10 | fn six_main(a: u8, b: i32, c: bool) -> i64 { |
| 11 | let o: own [u8; 4] = alloc(a); |
| 12 | let s: own [u8; 4] = alloc(3); |
| 13 | let m: own [u8; 4] = alloc(0); |
| 14 | let r: i64 = mix6(o, &s, &mut m, a, b as i64, c); |
| 15 | return r + (m[0] as i64); |
| 16 | } |