]> git.proxmox.com Git - rustc.git/blame - src/test/run-make/const_fn_mir/dump.mir
New upstream version 1.52.0~beta.3+dfsg1
[rustc.git] / src / test / run-make / const_fn_mir / dump.mir
CommitLineData
5869c6ff
XL
1// WARNING: This output format is intended for human consumers only
2// and is subject to change without notice. Knock yourself out.
3fn main() -> () {
4 let mut _0: (); // return place in scope 0 at main.rs:8:11: 8:11
5 let _1: i32; // in scope 0 at main.rs:9:5: 9:10
6
7 bb0: {
5869c6ff
XL
8 _1 = foo() -> bb1; // scope 0 at main.rs:9:5: 9:10
9 // mir::Constant
10 // + span: main.rs:9:5: 9:8
11 // + literal: Const { ty: fn() -> i32 {foo}, val: Value(Scalar(<ZST>)) }
12 }
13
14 bb1: {
5869c6ff
XL
15 return; // scope 0 at main.rs:10:2: 10:2
16 }
17}
18
19fn foo() -> i32 {
20 let mut _0: i32; // return place in scope 0 at main.rs:4:19: 4:22
21
22 bb0: {
23 _0 = const 11_i32; // scope 0 at main.rs:5:5: 5:10
24 return; // scope 0 at main.rs:6:2: 6:2
25 }
26}
27
28// MIR FOR CTFE
29fn foo() -> i32 {
30 let mut _0: i32; // return place in scope 0 at main.rs:4:19: 4:22
31 let mut _1: (i32, bool); // in scope 0 at main.rs:5:5: 5:10
32
33 bb0: {
34 _1 = CheckedAdd(const 5_i32, const 6_i32); // scope 0 at main.rs:5:5: 5:10
35 assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 5_i32, const 6_i32) -> bb1; // scope 0 at main.rs:5:5: 5:10
36 }
37
38 bb1: {
39 _0 = move (_1.0: i32); // scope 0 at main.rs:5:5: 5:10
40 return; // scope 0 at main.rs:6:2: 6:2
41 }
42}