rust/tests/codegen/intrinsics/const_eval_select.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
356 B
Rust
Raw Normal View History

2021-10-12 05:06:37 +00:00
// compile-flags: -C no-prepopulate-passes
#![crate_type = "lib"]
#![feature(const_eval_select)]
#![feature(core_intrinsics)]
2021-10-12 05:06:37 +00:00
use std::intrinsics::const_eval_select;
2021-10-14 07:35:35 +00:00
const fn foo(_: i32) -> i32 { 1 }
2021-10-12 05:06:37 +00:00
#[no_mangle]
2021-10-14 07:35:35 +00:00
pub fn hi(n: i32) -> i32 { n }
2021-10-12 05:06:37 +00:00
#[no_mangle]
pub unsafe fn hey() {
// CHECK: call i32 @hi(i32
const_eval_select((42,), foo, hi);
}