summaryrefslogtreecommitdiffstats
path: root/tests/codegen/intrinsics/nearby.rs
blob: 520fe2f1886ebea54bd02293869c455da47f46ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![crate_type = "lib"]
#![feature(core_intrinsics)]

use std::intrinsics;

// CHECK-LABEL: @nearbyintf32
#[no_mangle]
pub unsafe fn nearbyintf32(a: f32) -> f32 {
    // CHECK: llvm.nearbyint.f32
    intrinsics::nearbyintf32(a)
}

// CHECK-LABEL: @nearbyintf64
#[no_mangle]
pub unsafe fn nearbyintf64(a: f64) -> f64 {
    // CHECK: llvm.nearbyint.f64
    intrinsics::nearbyintf64(a)
}