aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/bugs/7187.zig
blob: bb2e82af890f26e5bc1ec4b69b38fe9db98f4376 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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();
    _ = y;

    try expect(x == 1);
}

fn getFalse() bool {
    return false;
}