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.
18 lines
453 B
Plaintext
18 lines
453 B
Plaintext
//ww:run-exit 7
|
|
package main;
|
|
type inst = struct { sec: i64, nsec: i64 };
|
|
fn cmp(a: inst, b: inst) i32 = {
|
|
if (a.sec < b.sec) { return -1; };
|
|
if (a.sec > b.sec) { return 1; };
|
|
if (a.nsec < b.nsec) { return -1; };
|
|
if (a.nsec > b.nsec) { return 1; };
|
|
return 0;
|
|
};
|
|
fn main() i32 = {
|
|
let x: inst = inst { sec = 5i64, nsec = 200i64 };
|
|
let y: inst = inst { sec = 5i64, nsec = 100i64 };
|
|
let r: i32 = cmp(x, y);
|
|
if (r > 0) { return 7; };
|
|
return 0;
|
|
};
|