mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 07:32:44 +00:00
17 lines
245 B
Zig
17 lines
245 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=stage2,llvm
|
|
// target=x86_64-linux,x86_64-macos
|
|
//
|