aboutsummaryrefslogtreecommitdiff
path: root/doc/langref/test_variadic_function.zig
blob: b47b75e1a89366bf0ebacdbf9436ec2dd57e6b1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
const std = @import("std");
const testing = std.testing;

pub extern "c" fn printf(format: [*:0]const u8, ...) c_int;

test "variadic function" {
    try testing.expect(printf("Hello, world!\n") == 14);
    try testing.expect(@typeInfo(@TypeOf(printf)).Fn.is_var_args);
}

// test
// link_libc
// verbose_cimport