mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
16 lines
319 B
Zig
16 lines
319 B
Zig
#link("c")
|
|
extern {
|
|
fn puts(s: *const u8) -> i32;
|
|
fn exit(code: i32) -> unreachable;
|
|
}
|
|
|
|
export fn _start() -> unreachable {
|
|
let a : i32 = 1;
|
|
let b = 2;
|
|
// let c : i32; // not yet support for const variables
|
|
// let d; // parse error
|
|
if (a + b == 3) {
|
|
puts("OK");
|
|
}
|
|
exit(0);
|
|
}
|