mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
16 lines
288 B
Zig
16 lines
288 B
Zig
const std = @import("std");
|
|
const builtin = @import("builtin");
|
|
const expect = std.testing.expect;
|
|
|
|
test "miscompilation with bool return type" {
|
|
var x: usize = 1;
|
|
var y: bool = getFalse();
|
|
_ = .{ &x, &y };
|
|
|
|
try expect(x == 1);
|
|
}
|
|
|
|
fn getFalse() bool {
|
|
return false;
|
|
}
|