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

// exe=fail