// nullable_assert_test — #17 (F4): `e as T` on a nullable `(*T|void)` operand // must discriminate POINTER-vs-NULL, not compare the pointer against a variant // tag index. Migrated from test/wcc/949_nullable_assert_run.c (success-path // value rows; cs==ww byte-id rides T2). The must-abort-on-mismatch polarity // rows stay as a carrier (an abort cannot be a @test row). // // For a nullable operand the slot word IS the pointer (no tag word, zero-cost // fold — NOT a 2-variant tagged union, which would exercise the wrong // lowering). Pre-fix wwstage cgtypeassert CMPQ'd against the pointer and // unwrapped past the 8B slot. asrt_ptr_ok exercises the success arm (valid ptr // unwrap + deref); asrt_void_target_ok exercises the void-target arm. package nullable_assert_test; @test fn asrt_ptr_ok() void = { let x: int = 42; let p: (*int|void) = &x; assert(p is *int); let q: *int = p as *int; assert((*q): i32 == 42); }; @test fn asrt_void_target_ok() void = { let p: (*int|void) = void; assert(p is void); let z = p as void; };