zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 10218dd096cfecf20791c0011a935ba7e4589ee9 (tree)
parent 18fe951e24e55c7c732c3f1fc6bf412d7c4e2710
Author: r00ster91 <r00ster91@proton.me>
Date:   Sun, 28 May 2023 02:46:34 +0200

test cases: never-inline call of inline function with comptime parameter

Closes #5995

Diffstat:
Atest/cases/compile_errors/never_inline_call_of_inline_fn_with_comptime_param.zig | 23+++++++++++++++++++++++
1 file changed, 23 insertions(+), 0 deletions(-)

diff --git a/test/cases/compile_errors/never_inline_call_of_inline_fn_with_comptime_param.zig b/test/cases/compile_errors/never_inline_call_of_inline_fn_with_comptime_param.zig @@ -0,0 +1,23 @@ +extern var X: *volatile i32; + +inline fn fiveXwithType(comptime T: type) void { + _ = T; + X.* = 5; +} + +inline fn fiveXwithArg(v: i32) void { + _ = v; + X.* = 5; +} + +export fn entry1() void { + @call(.never_inline, fiveXwithType, .{i32}); +} +export fn entry2() void { + @call(.never_inline, fiveXwithArg, .{1}); +} + +// error +// +// :14:5: error: 'never_inline' call of inline function +// :17:5: error: 'never_inline' call of inline function