aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/bugs/11227.zig
blob: 2699b5424733e720afb55293e12a651117efe8b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
const std = @import("std");
const builtin = @import("builtin");

fn foo() u32 {
    return 11227;
}
const bar = foo;
test "pointer to alias behaves same as pointer to function" {
    if (builtin.zig_backend == .stage1) return error.SkipZigTest; // stage1 has different function pointers

    var a = &bar;
    try std.testing.expect(foo() == a());
}