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.
20 lines
587 B
Plaintext
20 lines
587 B
Plaintext
//ww:run-exit 42
|
|
// Migrated from 776_memio_vstream_run row fixed_read_5.
|
|
package main;
|
|
import memio;
|
|
import io;
|
|
import os;
|
|
export fn main() i32 = {
|
|
let buf: [8]u8;
|
|
buf[0] = 65u8; buf[1] = 66u8; buf[2] = 67u8; buf[3] = 68u8;
|
|
buf[4] = 69u8; buf[5] = 70u8; buf[6] = 71u8; buf[7] = 72u8;
|
|
let st: memio.stream = memio.fixed(buf[0:8]);
|
|
let s: io.stream = &st.vt;
|
|
let out: [5]u8;
|
|
let n: size = 0;
|
|
let rd = io.read(s, out[0:5]);
|
|
if (rd is size) { n = rd as size; };
|
|
if (n == 5: size && out[0] == 65u8 && out[4] == 69u8) { return 42; };
|
|
return 99;
|
|
};
|