Files
ww/test/wcc/data/r700_sum_param_u8_slice/case.ww
Hojun-Cho 956246b3f0 test: migrate 700_e2e rows to corpus fixtures; retire the carrier
136 rows migrated, 0 already owned, 3 wwstage-failing rows held out.
2026-08-08 14:10:46 +09:00

24 lines
561 B
Plaintext

//ww:run-exit 40
// Migrated from 700_e2e row 125.
package main;
import bytes;
fn main() i32 = {
let buf: [4]u8;
buf[0] = 1u8; buf[1] = 2u8; buf[2] = 3u8; buf[3] = 4u8;
let needle: [2]u8;
needle[0] = 3u8; needle[1] = 4u8;
let r1: (i32 | void) = bytes.index(buf[0:4], 3u8);
let r2: (i32 | void) = bytes.index(buf[0:4], needle[0:2]);
let a: i32 = 99;
let b: i32 = 99;
match (r1) {
case let i: i32 => a = i;
case void => a = -1;
};
match (r2) {
case let i: i32 => b = i;
case void => b = -1;
};
return a * 10 + b + 18;
};