1 // This file tests that we don't generate any code for saturation when using the
2 // unchecked intrinsics.
4 // compile-flags: -C opt-level=3
5 // ignore-wasm32 the wasm target is tested in `wasm_casts_*`
9 // CHECK-LABEL: @f32_to_u32
11 pub fn f32_to_u32(x: f32) -> u32 {
16 unsafe { x.to_int_unchecked() }
19 // CHECK-LABEL: @f32_to_i32
21 pub fn f32_to_i32(x: f32) -> i32 {
26 unsafe { x.to_int_unchecked() }
30 pub fn f64_to_u16(x: f64) -> u16 {
35 unsafe { x.to_int_unchecked() }