aboutsummaryrefslogtreecommitdiff
path: root/test/cases/arithmetic_operations.5.zig
blob: b1c18ca7da2ffed288f42f414fc64b42e6e552be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pub fn main() void {
    var x: u32 = 1;
    assert(x << 1 == 2);

    x <<= 1;
    assert(x << 2 == 8);
    assert(x << 3 == 16);
}

pub fn assert(ok: bool) void {
    if (!ok) unreachable; // assertion failure
}

// run
//