mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 23:52:31 +00:00
171977dc1c
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.
17 lines
291 B
Zig
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
|
|
//
|