test_variadic_function.zig (316B) - Raw
1 const std = @import("std"); 2 const testing = std.testing; 3 4 pub extern "c" fn printf(format: [*:0]const u8, ...) c_int; 5 6 test "variadic function" { 7 try testing.expect(printf("Hello, world!\n") == 14); 8 try testing.expect(@typeInfo(@TypeOf(printf)).@"fn".is_var_args); 9 } 10 11 // test 12 // link_libc 13 // verbose_cimport