mirror of
https://github.com/ziglang/zig.git
synced 2026-01-18 13:25:15 +00:00
17 lines
280 B
Zig
17 lines
280 B
Zig
|
|
fn inlinedLoop() {
|
|
@setFnTest(this);
|
|
|
|
inline var i = 0;
|
|
inline var sum = 0;
|
|
inline while (i <= 5; i += 1)
|
|
sum += i;
|
|
assert(sum == 15);
|
|
}
|
|
|
|
// TODO const assert = @import("std").debug.assert;
|
|
fn assert(ok: bool) {
|
|
if (!ok)
|
|
@unreachable();
|
|
}
|