aboutsummaryrefslogtreecommitdiff
path: root/doc/langref/runtime_shrExact_overflow.zig
blob: 98da0dde1191d434baa623c998bbeced7a7cb518 (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() or builtin.cpu.arch.isLoongArch()) and builtin.zig_backend == .stage2_llvm) @panic("https://github.com/ziglang/zig/issues/24304");
}

// exe=fail