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.
19 lines
512 B
Plaintext
19 lines
512 B
Plaintext
//ww:run-exit 27
|
|
package pkg;
|
|
export type point = struct { x: i64, y: i64 };
|
|
export type rect = struct { lo: point, hi: point };
|
|
package main;
|
|
import pkg;
|
|
fn mk(vx: i64, vy: i64) pkg.point = {
|
|
return pkg.point { x = vx, y = vy };
|
|
};
|
|
export fn main() i32 = {
|
|
let a: pkg.point = mk(8i64, 2i64);
|
|
a = pkg.point { x = 15i64, y = 5i64 };
|
|
if (a.x != 15i64) { return 1; };
|
|
if (a.y != 5i64) { return 2; };
|
|
let b: pkg.point = mk(3i64, 4i64);
|
|
if (b.x != 3i64) { return 3; };
|
|
return (a.x + a.y + b.x + b.y): i32;
|
|
};
|