Files
ww/test/lang/is_nonident_test.ww
Hojun-Cho 246e5bb90e test: migrate Fam9 match/tagged value tests to @test (#5-C5)
fold-2 chunk C5 (drew's Fam8-13 plan), the highest-risk chunk: 21 match/tagged
value-row C drivers re-homed. 20 -> test/lang/*_test.ww @test row-tables + 12
runww //ww:error carriers (both stages reject). The global-tag cluster
(globtag*/globstructwiden/taggedderefstore/...), which sits on the #15/#17
global-ptr fix, was empirically probed byte-id CLEAN -- the predicted hotspot
surfaced ZERO fresh cs!=ww. Carves: variant_chain_b95 #81 -> _runonly (genuinely
diverges at HEAD); callret_bound277 #277 -> slim C pin (cs-runs/ww-rejects),
mutation-gated. 929_tagged_memarg kept whole (SSE-ABI asm conformance). 19
drivers deleted, 944_variant_chain slimmed to the #277 pin.

The match-on-tagged-struct-field divergence (former #26) probed RESOLVED for all
its cited shapes (938 voidstr_field/recursion_torture, tagnorm dedup_match all
byte-id cs==ww + value-correct) -- closed no-reproducer-at-HEAD, attribution to
#15/#17 INFERRED. Those rows migrate as normal byte-id @test and serve as the
REGRESSION SENTINEL for the inferred close (a resurgence trips the gate).

LANGBYTEID floor 93->113; test count 374->355 (19 deleted; 929 + 944_variant_chain
kept). do-not-auto-batch (926_tagscr/940_global_sret/940_str_forrange) untouched.
2026-06-24 20:42:08 +09:00

91 lines
2.0 KiB
Plaintext

// is_nonident_test — `e is T` on non-ident scrutinees (indexed, dot-field,
// call-result, slice-variant, nullable (*T|void) on dot-field and ident). Each
// pins both polarities. Migrated from test/wcc/927_is_nonident_run.c (value
// rows; the C driver already asserted cs==ww .s, so byte-id holds).
package is_nonident_test;
type p48 = struct { a: i64, b: i64, c: i64, d: i64, e: i64, f: i64 };
type small = (p48 | bool);
type holder = struct { v: small, k: i64 };
type val = (i64 | bool);
type valslice = (i64 | []u8);
type t = struct { a: i64 };
type maybe = (*t | void);
type nholder = struct { m: maybe, k: i64 };
fn mk(flag: bool) val = {
if (flag) {
let b: bool = true;
return b;
};
let n: i64 = 7;
return n;
};
@test fn indexed() void = {
let xs: []small;
let b: bool = true;
let v: small = b;
append(xs, v);
assert(xs.len != 0 && xs[xs.len - 1] is bool);
assert(!(xs[xs.len - 1] is p48));
assert(xs[0] is bool);
};
@test fn dot_field() void = {
let b: bool = true;
let h: holder = holder { v = b, k = 5 };
assert(h.v is bool);
assert(!(h.v is p48));
};
@test fn call_result() void = {
assert(mk(true) is bool);
assert(mk(false) is i64);
assert(!(mk(true) is i64));
};
@test fn slice_variant_indexed() void = {
let xs: []valslice;
let buf: [2]u8 = [1u8, 2u8];
let s: []u8 = buf[0:2];
let v: valslice = s;
append(xs, v);
let n: i64 = 5;
let w: valslice = n;
append(xs, w);
assert(xs[0] is []u8);
assert(xs[1] is i64);
assert(!(xs[0] is i64));
};
@test fn nullable_dot_field() void = {
let v: t = t { a = 5 };
let h: nholder = nholder { m = &v, k = 1 };
assert(h.m is *t);
assert(!(h.m is void));
let h2: nholder = nholder { m = void, k = 2 };
assert(!(h2.m is *t));
assert(h2.m is void);
};
@test fn nullable_ident() void = {
let v: t = t { a = 5 };
let m: maybe = &v;
assert(m is *t);
assert(!(m is void));
let m2: maybe = void;
assert(!(m2 is *t));
assert(m2 is void);
};
@test fn ident_control() void = {
let b: bool = true;
let v: val = b;
assert(v is bool);
assert(!(v is i64));
};