zig/test/cases/simple_if_statement.zig
Alex Rønne Petersen 4dba253cd2
test: pull tests in test/cases/llvm/ up to test/cases/
There is nothing inherently LLVM-specific about any of these.
2025-09-16 23:39:29 +02:00

16 lines
231 B
Zig

fn add(a: i32, b: i32) i32 {
return a + b;
}
fn assert(ok: bool) void {
if (!ok) unreachable;
}
pub fn main() void {
assert(add(1, 2) == 3);
}
// run
// backend=selfhosted,llvm
// target=x86_64-linux,x86_64-macos
//