The r-prefixed waves absorb the runtime, reject, and byte-compare rows of the migrated native carriers; each fixture is one directory with one case.ww and a //ww:error, //ww:compile, //ww:run, or //ww:run-exit directive covering both frontends.
7 lines
394 B
Plaintext
7 lines
394 B
Plaintext
//ww:run-exit 6
|
|
package main;
|
|
type three = struct { a: i32, b: i32, c: i32 };
|
|
fn make(flag: i32) three = { if (flag == 0) { return three { a = 1i32, b = 2i32, c = 3i32 }; }; return three { a = 10i32, b = 20i32, c = 30i32 }; };
|
|
fn use_(p: three, which: i32) i32 = { if (which == 0) { return p.a + p.b + p.c; }; return p.a * p.b * p.c; };
|
|
fn main() i32 = { let p = make(0); return use_(p, 0); };
|