mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
4dba253cd2
There is nothing inherently LLVM-specific about any of these.
17 lines
249 B
Zig
17 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
|
|
//
|