aboutsummaryrefslogtreecommitdiff
path: root/test/cases/for_loop.zig
blob: 3be46777d807683a981a57e359a85145fb99f0b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
//