]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff
rustc_codegen_llvm: Give each codegen unit a unique DWARF name on all
[rust.git] / src / test / mir-opt / const_prop / slice_len.main.ConstProp.32bit.diff
1 - // MIR for `main` before ConstProp
2 + // MIR for `main` after ConstProp
3   
4   fn main() -> () {
5       let mut _0: ();                      // return place in scope 0 at $DIR/slice_len.rs:4:11: 4:11
6       let _1: u32;                         // in scope 0 at $DIR/slice_len.rs:5:5: 5:33
7       let mut _2: &[u32];                  // in scope 0 at $DIR/slice_len.rs:5:5: 5:30
8       let mut _3: &[u32; 3];               // in scope 0 at $DIR/slice_len.rs:5:6: 5:19
9       let _4: &[u32; 3];                   // in scope 0 at $DIR/slice_len.rs:5:6: 5:19
10       let _5: [u32; 3];                    // in scope 0 at $DIR/slice_len.rs:5:7: 5:19
11       let _6: usize;                       // in scope 0 at $DIR/slice_len.rs:5:31: 5:32
12       let mut _7: usize;                   // in scope 0 at $DIR/slice_len.rs:5:5: 5:33
13       let mut _8: bool;                    // in scope 0 at $DIR/slice_len.rs:5:5: 5:33
14       let mut _9: &[u32; 3];               // in scope 0 at $DIR/slice_len.rs:5:6: 5:19
15       let mut _10: &[u32; 3];              // in scope 0 at $DIR/slice_len.rs:5:6: 5:19
16   
17       bb0: {
18           StorageLive(_1);                 // scope 0 at $DIR/slice_len.rs:5:5: 5:33
19           StorageLive(_2);                 // scope 0 at $DIR/slice_len.rs:5:5: 5:30
20           StorageLive(_3);                 // scope 0 at $DIR/slice_len.rs:5:6: 5:19
21           StorageLive(_4);                 // scope 0 at $DIR/slice_len.rs:5:6: 5:19
22           _9 = const main::promoted[0];    // scope 0 at $DIR/slice_len.rs:5:6: 5:19
23                                            // ty::Const
24                                            // + ty: &[u32; 3]
25                                            // + val: Unevaluated(main, [], Some(promoted[0]))
26                                            // mir::Constant
27                                            // + span: $DIR/slice_len.rs:5:6: 5:19
28                                            // + literal: Const { ty: &[u32; 3], val: Unevaluated(Unevaluated { def: WithOptConstParam { did: DefId(0:3 ~ slice_len[6547]::main), const_param_did: None }, substs_: Some([]), promoted: Some(promoted[0]) }) }
29           _4 = _9;                         // scope 0 at $DIR/slice_len.rs:5:6: 5:19
30           _3 = _4;                         // scope 0 at $DIR/slice_len.rs:5:6: 5:19
31           StorageLive(_10);                // scope 0 at $DIR/slice_len.rs:5:6: 5:19
32           _10 = _3;                        // scope 0 at $DIR/slice_len.rs:5:6: 5:19
33           _2 = move _3 as &[u32] (Pointer(Unsize)); // scope 0 at $DIR/slice_len.rs:5:6: 5:19
34           StorageDead(_3);                 // scope 0 at $DIR/slice_len.rs:5:18: 5:19
35           StorageLive(_6);                 // scope 0 at $DIR/slice_len.rs:5:31: 5:32
36           _6 = const 1_usize;              // scope 0 at $DIR/slice_len.rs:5:31: 5:32
37           _7 = const 3_usize;              // scope 0 at $DIR/slice_len.rs:5:5: 5:33
38           StorageDead(_10);                // scope 0 at $DIR/slice_len.rs:5:5: 5:33
39 -         _8 = Lt(_6, _7);                 // scope 0 at $DIR/slice_len.rs:5:5: 5:33
40 -         assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
41 +         _8 = const true;                 // scope 0 at $DIR/slice_len.rs:5:5: 5:33
42 +         assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
43       }
44   
45       bb1: {
46 -         _1 = (*_2)[_6];                  // scope 0 at $DIR/slice_len.rs:5:5: 5:33
47 +         _1 = const 2_u32;                // scope 0 at $DIR/slice_len.rs:5:5: 5:33
48           StorageDead(_6);                 // scope 0 at $DIR/slice_len.rs:5:33: 5:34
49           StorageDead(_4);                 // scope 0 at $DIR/slice_len.rs:5:33: 5:34
50           StorageDead(_2);                 // scope 0 at $DIR/slice_len.rs:5:33: 5:34
51           StorageDead(_1);                 // scope 0 at $DIR/slice_len.rs:5:33: 5:34
52           nop;                             // scope 0 at $DIR/slice_len.rs:4:11: 6:2
53           return;                          // scope 0 at $DIR/slice_len.rs:6:2: 6:2
54       }
55   }
56