Files
zig/test/cases/compile_errors/call_from_naked_func.zig
Jacob Young 89d660c3eb Sema: improve new error messages related to naked functions
* pass a source location to all safety checks
 * add notes about what is disallowed in naked functions

Closes #16651
2023-08-02 16:12:30 -07:00

25 lines
487 B
Zig

export fn runtimeCall() callconv(.Naked) void {
f();
}
export fn runtimeBuiltinCall() callconv(.Naked) void {
@call(.auto, f, .{});
}
export fn comptimeCall() callconv(.Naked) void {
comptime f();
}
export fn comptimeBuiltinCall() callconv(.Naked) void {
@call(.compile_time, f, .{});
}
fn f() void {}
// error
// backend=llvm
// target=native
//
// :2:6: error: runtime call not allowed in naked function
// :6:5: error: runtime @call not allowed in naked function