| 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.expectEqual(14, printf("Hello, world!\n")); |
| 8 | try testing.expect(@typeInfo(@TypeOf(printf)).@"fn".attrs.varargs); |
| 9 | } |
| 10 | |
| 11 | // test |
| 12 | // link_libc |