zig/test/cases3/if.zig

27 lines
434 B
Zig
Raw Normal View History

2016-12-22 13:20:14 +08:00
fn ifStatements() {
@setFnTest(this);
shouldBeEqual(1, 1);
firstEqlThird(2, 1, 2);
}
fn shouldBeEqual(a: i32, b: i32) {
if (a != b) {
@unreachable();
} else {
return;
}
}
fn firstEqlThird(a: i32, b: i32, c: i32) {
if (a == b) {
@unreachable();
} else if (b == c) {
@unreachable();
} else if (a == c) {
return;
} else {
@unreachable();
}
}