add div_exact builtin fn

closes #149
This commit is contained in:
Andrew Kelley
2016-05-07 20:53:16 -07:00
parent eb83111f02
commit 404defd99b
8 changed files with 153 additions and 3 deletions

View File

@@ -1456,6 +1456,16 @@ fn div0(a: i32, b: i32) -> i32 {
}
)SOURCE");
add_debug_safety_case("exact division failure", R"SOURCE(
pub fn main(args: [][]u8) -> %void {
div_exact(10, 3);
}
#static_eval_enable(false)
fn div_exact(a: i32, b: i32) -> i32 {
@div_exact(a, b)
}
)SOURCE");
}
//////////////////////////////////////////////////////////////////////////////