summary refs log tree commit diff
path: root/src/test/codegen/intrinsics/const_eval_select.rs
blob: 34e653b4b9dd45e7855f64b10b6bcff8e5978a9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// compile-flags: -C no-prepopulate-passes

#![crate_type = "lib"]
#![feature(const_eval_select)]

use std::intrinsics::const_eval_select;

const fn foo(_: i32) -> i32 { 1 }

#[no_mangle]
pub fn hi(n: i32) -> i32 { n }

#[no_mangle]
pub unsafe fn hey() {
    // CHECK: call i32 @hi(i32
    const_eval_select((42,), foo, hi);
}