| ... | ... | @@ -1663,6 +1663,27 @@ pub fn addCases(ctx: *TestContext) !void { |
| 1663 | 1663 | ); |
| 1664 | 1664 | } |
| 1665 | 1665 | } |
| 1666 | |
| 1667 | { |
| 1668 | var case = ctx.exe("issue 7187: miscompilation with bool return type", linux_x64); |
| 1669 | case.addCompareOutput( |
| 1670 | \\pub fn main() void { |
| 1671 | \\ var x: usize = 1; |
| 1672 | \\ var y: bool = getFalse(); |
| 1673 | \\ _ = y; |
| 1674 | \\ |
| 1675 | \\ assert(x == 1); |
| 1676 | \\} |
| 1677 | \\ |
| 1678 | \\fn getFalse() bool { |
| 1679 | \\ return false; |
| 1680 | \\} |
| 1681 | \\ |
| 1682 | \\fn assert(ok: bool) void { |
| 1683 | \\ if (!ok) unreachable; |
| 1684 | \\} |
| 1685 | , ""); |
| 1686 | } |
| 1666 | 1687 | } |
| 1667 | 1688 | |
| 1668 | 1689 | fn addLinuxTestCases(ctx: *TestContext) !void { |