aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/invalid_extern_function_call.zig
blob: 887d2e1da01f7dc48177c628349161be8a50cd83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const x = @extern(*const fn () callconv(.c) void, .{ .name = "foo" });

export fn entry0() void {
    comptime x();
}

export fn entry1() void {
    @call(.always_inline, x, .{});
}

// error
//
// :4:15: error: comptime call of extern function
// :4:5: note: 'comptime' keyword forces comptime evaluation
// :8:5: error: inline call of extern function