add div_exact builtin fn

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

No files matched your search

+10
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");
}
//////////////////////////////////////////////////////////////////////////////