mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 12:59:04 +00:00
test cases: never-inline call of inline function with comptime parameter
Closes #5995
This commit is contained in:
parent
18fe951e24
commit
10218dd096
@ -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
|
||||
Loading…
x
Reference in New Issue
Block a user