aboutsummaryrefslogtreecommitdiff
path: root/doc/langref/runtime_shrExact_overflow.zig
blob: 1350e9da75d4e1dc0035066679288f8eb14c7127 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
const builtin = @import("builtin");
const std = @import("std");

pub fn main() void {
    var x: u8 = 0b10101010; // runtime-known
    _ = &x;
    const y = @shrExact(x, 2);
    std.debug.print("value: {}\n", .{y});

    if (builtin.cpu.arch.isRISCV() and builtin.zig_backend == .stage2_llvm) @panic("https://github.com/ziglang/zig/issues/24304");
}

// exe=fail