rust/tests/run-make/const_fn_mir/dump.mir

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

46 lines
1023 B
Rust
Raw Normal View History

// WARNING: This output format is intended for human consumers only
// and is subject to change without notice. Knock yourself out.
fn foo() -> i32 {
2023-06-06 08:47:00 -05:00
let mut _0: i32;
let mut _1: (i32, bool);
bb0: {
2023-06-06 08:47:00 -05:00
_1 = CheckedAdd(const 5_i32, const 6_i32);
2023-06-23 11:53:09 -05:00
assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 5_i32, const 6_i32) -> [success: bb1, unwind continue];
2023-04-05 14:42:01 -05:00
}
bb1: {
2023-06-06 08:47:00 -05:00
_0 = move (_1.0: i32);
return;
}
}
// MIR FOR CTFE
fn foo() -> i32 {
2023-06-06 08:47:00 -05:00
let mut _0: i32;
let mut _1: (i32, bool);
bb0: {
2023-06-06 08:47:00 -05:00
_1 = CheckedAdd(const 5_i32, const 6_i32);
2023-06-23 11:53:09 -05:00
assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 5_i32, const 6_i32) -> [success: bb1, unwind continue];
}
bb1: {
2023-06-06 08:47:00 -05:00
_0 = move (_1.0: i32);
return;
}
}
fn main() -> () {
2023-06-06 08:47:00 -05:00
let mut _0: ();
let _1: i32;
bb0: {
2023-06-23 11:53:09 -05:00
_1 = foo() -> [return: bb1, unwind continue];
}
bb1: {
2023-06-06 08:47:00 -05:00
return;
}
}