zig/test/cases/pointers.0.zig

15 lines
143 B
Zig
Raw Normal View History

2022-04-27 21:59:55 +01:00
pub fn main() u8 {
var x: u8 = 0;
foo(&x);
return x - 2;
}
fn foo(x: *u8) void {
x.* = 2;
}
// run
// target=wasm32-wasi
//