mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-26 13:01:34 +03:00
67a5b6e5e8
closes #20630
13 lines
300 B
Zig
13 lines
300 B
Zig
const std = @import("std");
|
|
const testing = std.testing;
|
|
|
|
pub extern "c" fn printf(format: [*:0]const u8, ...) c_int;
|
|
|
|
test "variadic function" {
|
|
try testing.expectEqual(14, printf("Hello, world!\n"));
|
|
try testing.expect(@typeInfo(@TypeOf(printf)).@"fn".is_var_args);
|
|
}
|
|
|
|
// test
|
|
// link_libc
|