Files
ww/test/wcc/data/r71_struct_byval_two16/case.ww
Hojun-Cho d456263f7e test/wcc/data: grow the declarative compiler corpus to 1,224 fixtures
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.
2026-08-07 23:21:04 +09:00

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;
};