/
return_place.rs
57 lines (54 loc) · 1.25 KB
/
return_place.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// compile-flags: -C overflow-checks=on
fn add() -> u32 {
2 + 2
}
fn main() {
add();
}
// END RUST SOURCE
// START rustc.add.ConstProp.before.mir
// fn add() -> u32 {
// let mut _0: u32;
// let mut _1: (u32, bool);
// bb0: {
// _1 = CheckedAdd(const 2u32, const 2u32);
// assert(!move (_1.1: bool), "attempt to add with overflow") -> bb1;
// }
// bb1: {
// _0 = move (_1.0: u32);
// return;
// }
// bb2 (cleanup): {
// resume;
// }
// }
// END rustc.add.ConstProp.before.mir
// START rustc.add.ConstProp.after.mir
// fn add() -> u32 {
// let mut _0: u32;
// let mut _1: (u32, bool);
// bb0: {
// _1 = (const 4u32, const false);
// assert(!const false, "attempt to add with overflow") -> bb1;
// }
// bb1: {
// _0 = const 4u32;
// return;
// }
// bb2 (cleanup): {
// resume;
// }
// }
// END rustc.add.ConstProp.after.mir
// START rustc.add.PreCodegen.before.mir
// fn add() -> u32 {
// let mut _0: u32;
// let mut _1: (u32, bool);
// bb0: {
// (_1.0: u32) = const 4u32;
// (_1.1: bool) = const false;
// _0 = const 4u32;
// return;
// }
// }
// END rustc.add.PreCodegen.before.mir