2022-08-03 06:30:13 -05:00
|
|
|
#![feature(core_intrinsics)]
|
|
|
|
|
|
|
|
extern crate core;
|
2024-02-01 16:45:00 -06:00
|
|
|
use core::intrinsics::mir::*; //~ custom_mir
|
2022-08-03 06:30:13 -05:00
|
|
|
|
|
|
|
#[custom_mir(dialect = "built")] //~ ERROR the `#[custom_mir]` attribute is just used for the Rust test suite
|
|
|
|
pub fn foo(_x: i32) -> i32 {
|
2024-02-01 16:45:00 -06:00
|
|
|
mir! {
|
|
|
|
{
|
|
|
|
Return() //~ custom_mir
|
|
|
|
}
|
|
|
|
}
|
2022-08-03 06:30:13 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
assert_eq!(2, foo(2));
|
|
|
|
}
|