std: update uses of .Inline callconv

This commit is contained in:
mlugg 2024-10-16 11:41:51 +01:00
parent 3ef8bb6354
commit 830230176d
No known key found for this signature in database
GPG Key ID: 3F5B7DCCBF4AF02E
2 changed files with 6 additions and 6 deletions

View File

@ -265,4 +265,4 @@ pub fn __builtin_mul_overflow(a: anytype, b: anytype, result: *@TypeOf(a, b)) c_
// It is used in a run-translated-c test and a test-translate-c test to ensure that non-implemented
// builtins are correctly demoted. If you implement __builtin_alloca_with_align, please update the
// run-translated-c test and the test-translate-c test to use a different non-implemented builtin.
// pub fn __builtin_alloca_with_align(size: usize, alignment: usize) callconv(.Inline) *anyopaque {}
// pub inline fn __builtin_alloca_with_align(size: usize, alignment: usize) *anyopaque {}

View File

@ -107,15 +107,15 @@ test "zig fmt: respect line breaks before functions" {
);
}
test "zig fmt: rewrite callconv(.Inline) to the inline keyword" {
test "zig fmt: rewrite callconv(.@\"inline\") to the inline keyword" {
try testTransform(
\\fn foo() callconv(.Inline) void {}
\\const bar = .Inline;
\\fn foo() callconv(.@"inline") void {}
\\const bar: @import("std").builtin.CallingConvention = .@"inline";
\\fn foo() callconv(bar) void {}
\\
,
\\inline fn foo() void {}
\\const bar = .Inline;
\\const bar: @import("std").builtin.CallingConvention = .@"inline";
\\fn foo() callconv(bar) void {}
\\
);
@ -3062,7 +3062,7 @@ test "zig fmt: functions" {
\\pub export fn puts(s: *const u8) align(2 + 2) c_int;
\\pub inline fn puts(s: *const u8) align(2 + 2) c_int;
\\pub noinline fn puts(s: *const u8) align(2 + 2) c_int;
\\pub fn callInlineFn(func: fn () callconv(.Inline) void) void {
\\pub fn callInlineFn(func: fn () callconv(.@"inline") void) void {
\\ func();
\\}
\\