mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 13:04:42 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			23 lines
		
	
	
		
			379 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			379 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //@ compile-flags: -C no-prepopulate-passes -Copt-level=0
 | |
| 
 | |
| #![crate_type = "lib"]
 | |
| #![feature(const_eval_select)]
 | |
| #![feature(core_intrinsics)]
 | |
| 
 | |
| 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);
 | |
| }
 | 
