2022-12-30 14:11:30 -06:00
|
|
|
//@ compile-flags: -C no-prepopulate-passes -Copt-level=0
|
2021-10-12 00:06:37 -05:00
|
|
|
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
#![feature(const_eval_select)]
|
2022-04-11 20:12:26 -05:00
|
|
|
#![feature(core_intrinsics)]
|
2021-10-12 00:06:37 -05:00
|
|
|
|
|
|
|
use std::intrinsics::const_eval_select;
|
|
|
|
|
2024-05-28 23:11:20 -05:00
|
|
|
const fn foo(_: i32) -> i32 {
|
|
|
|
1
|
|
|
|
}
|
2021-10-12 00:06:37 -05:00
|
|
|
|
|
|
|
#[no_mangle]
|
2024-05-28 23:11:20 -05:00
|
|
|
pub fn hi(n: i32) -> i32 {
|
|
|
|
n
|
|
|
|
}
|
2021-10-12 00:06:37 -05:00
|
|
|
|
|
|
|
#[no_mangle]
|
|
|
|
pub unsafe fn hey() {
|
2022-12-30 14:11:30 -06:00
|
|
|
// CHECK: call i32 @hi(i32
|
2021-10-12 00:06:37 -05:00
|
|
|
const_eval_select((42,), foo, hi);
|
|
|
|
}
|