mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
16 lines
249 B
Zig
16 lines
249 B
Zig
fn assert(ok: bool) void {
|
|
if (!ok) unreachable;
|
|
}
|
|
|
|
pub fn main() void {
|
|
var x: u32 = 0;
|
|
for ("hello") |_| {
|
|
x += 1;
|
|
}
|
|
assert("hello".len == x);
|
|
}
|
|
|
|
// run
|
|
// backend=selfhosted,llvm
|
|
// target=x86_64-linux,x86_64-macos
|
|
//
|