This is all of the expected 0.14.0 progress on #21530, which can now be postponed once this commit is merged. This required rewriting the (un)wrap operations since the original implementations were extremely buggy. Also adds an easy way to retrigger Sema OPV bugs so that I don't have to keep updating #22419 all the time.
25 lines
489 B
Zig
25 lines
489 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=stage2
|
|
// target=native
|
|
//
|
|
// :2:6: error: runtime call not allowed in naked function
|
|
// :6:5: error: runtime @call not allowed in naked function
|