mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-06-23 00:50:57 -04:00
2e3fac3626
backend=auto (now the default if backend is omitted) means to let the compiler pick whatever backend it wants as the default. This is important for platforms where we don't yet have a self-hosted backend, such as loongarch64. Also purge a bunch of redundant target=native.
23 lines
454 B
Zig
23 lines
454 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
|
|
//
|
|
// :2:6: error: runtime call not allowed in naked function
|
|
// :6:5: error: runtime @call not allowed in naked function
|