zig/test/behavior/bugs/13164.zig
Veikka Tuominen 4e134f6dcb Sema: respect inline call semantics
If an argument is comptime-known but shouldn't be create an alloc
to store it in to get a runtime-known value.
2022-10-19 01:38:18 +03:00

17 lines
430 B
Zig

const std = @import("std");
const builtin = @import("builtin");
inline fn setLimits(min: ?u32, max: ?u32) !void {
if (min != null and max != null) {
try std.testing.expect(min.? <= max.?);
}
}
test {
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
var x: u32 = 42;
try setLimits(x, null);
}