mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-28 11:38:01 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			21 lines
		
	
	
		
			355 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			355 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| // compile-flags: -Z span_free_formats
 | |
| 
 | |
| // Tests that MIR inliner works for any operand
 | |
| 
 | |
| fn main() {
 | |
|     println!("{}", bar());
 | |
| }
 | |
| 
 | |
| // EMIT_MIR inline_any_operand.bar.Inline.after.mir
 | |
| fn bar() -> bool {
 | |
|     // CHECK-LABEL: fn bar(
 | |
|     // CHECK: (inlined foo)
 | |
|     let f = foo;
 | |
|     f(1, -1)
 | |
| }
 | |
| 
 | |
| #[inline(always)]
 | |
| fn foo(x: i32, y: i32) -> bool {
 | |
|     x == y
 | |
| }
 | 
