2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2015-06-10 15:33:52 -05:00
|
|
|
#![feature(core_intrinsics)]
|
2015-03-05 20:33:58 -06:00
|
|
|
|
2014-10-15 18:44:44 -05:00
|
|
|
use std::intrinsics::assume;
|
|
|
|
|
|
|
|
unsafe fn f(x: i32) -> i32 {
|
|
|
|
assume(x == 34);
|
|
|
|
match x {
|
|
|
|
34 => 42,
|
|
|
|
_ => 30
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = unsafe { f(34) };
|
|
|
|
assert_eq!(x, 42);
|
|
|
|
}
|