aboutsummaryrefslogtreecommitdiff
path: root/test/standalone/simple/hello_world/hello_libc.zig
blob: 994ca31b8e23a9b8011ebe53c51f7b4f886b2fce (plain)
1
2
3
4
5
6
7
8
9
10
11
extern fn printf(format: [*:0]const u8, ...) c_int;
extern fn strlen(str: [*:0]const u8) usize;

const msg = "Hello, world!\n";

pub export fn main(argc: c_int, argv: **u8) c_int {
    _ = argv;
    _ = argc;
    if (printf(msg) != @as(c_int, @intCast(strlen(msg)))) return -1;
    return 0;
}