mirror of
https://github.com/ziglang/zig.git
synced 2025-12-25 23:53:15 +00:00
stage2 x86_64: add regression test for #7187
This commit is contained in:
parent
06286b05a4
commit
726ee671be
@ -1663,6 +1663,27 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var case = ctx.exe("issue 7187: miscompilation with bool return type", linux_x64);
|
||||
case.addCompareOutput(
|
||||
\\pub fn main() void {
|
||||
\\ var x: usize = 1;
|
||||
\\ var y: bool = getFalse();
|
||||
\\ _ = y;
|
||||
\\
|
||||
\\ assert(x == 1);
|
||||
\\}
|
||||
\\
|
||||
\\fn getFalse() bool {
|
||||
\\ return false;
|
||||
\\}
|
||||
\\
|
||||
\\fn assert(ok: bool) void {
|
||||
\\ if (!ok) unreachable;
|
||||
\\}
|
||||
, "");
|
||||
}
|
||||
}
|
||||
|
||||
fn addLinuxTestCases(ctx: *TestContext) !void {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user