zig/test/cases/f32_passed_to_variadic_fn.zig
Andrew Kelley 171977dc1c test-cases: fix incorrectly linking libc when backend is llvm
Now link_libc=1 must be used to link with libc, instead of the test
harness assuming that using the llvm backend means additionally linking
with libc.
2023-03-15 10:48:15 -07:00

17 lines
291 B
Zig

extern fn printf(format: [*:0]const u8, ...) c_int;
pub fn main() void {
var a: f64 = 2.0;
var b: f32 = 10.0;
_ = printf("f64: %f\n", a);
_ = printf("f32: %f\n", b);
}
// run
// backend=llvm
// target=x86_64-linux-gnu
// link_libc=1
//
// f64: 2.000000
// f32: 10.000000
//