]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/separate_const_switch.too_complex.PreCodegen.after.mir
Rollup merge of #96603 - Alexendoo:const-generics-tests, r=Mark-Simulacrum
[rust.git] / src / test / mir-opt / separate_const_switch.too_complex.PreCodegen.after.mir
1 // MIR for `too_complex` after PreCodegen
2
3 fn too_complex(_1: Result<i32, usize>) -> Option<i32> {
4     debug x => _1;                       // in scope 0 at $DIR/separate_const_switch.rs:9:16: 9:17
5     let mut _0: std::option::Option<i32>; // return place in scope 0 at $DIR/separate_const_switch.rs:9:42: 9:53
6     let mut _2: std::ops::ControlFlow<usize, i32>; // in scope 0 at $DIR/separate_const_switch.rs:14:11: 19:6
7     let mut _3: isize;                   // in scope 0 at $DIR/separate_const_switch.rs:16:13: 16:18
8     let _4: i32;                         // in scope 0 at $DIR/separate_const_switch.rs:16:16: 16:17
9     let mut _5: i32;                     // in scope 0 at $DIR/separate_const_switch.rs:16:44: 16:45
10     let _6: usize;                       // in scope 0 at $DIR/separate_const_switch.rs:17:17: 17:18
11     let mut _7: usize;                   // in scope 0 at $DIR/separate_const_switch.rs:17:42: 17:43
12     let _8: i32;                         // in scope 0 at $DIR/separate_const_switch.rs:20:31: 20:32
13     let mut _9: i32;                     // in scope 0 at $DIR/separate_const_switch.rs:20:42: 20:43
14     let _10: usize;                      // in scope 0 at $DIR/separate_const_switch.rs:21:28: 21:29
15     scope 1 {
16         debug v => _4;                   // in scope 1 at $DIR/separate_const_switch.rs:16:16: 16:17
17     }
18     scope 2 {
19         debug r => _6;                   // in scope 2 at $DIR/separate_const_switch.rs:17:17: 17:18
20     }
21     scope 3 {
22         debug v => _8;                   // in scope 3 at $DIR/separate_const_switch.rs:20:31: 20:32
23     }
24     scope 4 {
25         debug r => _10;                  // in scope 4 at $DIR/separate_const_switch.rs:21:28: 21:29
26     }
27
28     bb0: {
29         StorageLive(_2);                 // scope 0 at $DIR/separate_const_switch.rs:14:11: 19:6
30         _3 = discriminant(_1);           // scope 0 at $DIR/separate_const_switch.rs:15:15: 15:16
31         switchInt(move _3) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/separate_const_switch.rs:15:9: 15:16
32     }
33
34     bb1: {
35         StorageLive(_6);                 // scope 0 at $DIR/separate_const_switch.rs:17:17: 17:18
36         _6 = ((_1 as Err).0: usize);     // scope 0 at $DIR/separate_const_switch.rs:17:17: 17:18
37         StorageLive(_7);                 // scope 2 at $DIR/separate_const_switch.rs:17:42: 17:43
38         _7 = _6;                         // scope 2 at $DIR/separate_const_switch.rs:17:42: 17:43
39         Deinit(_2);                      // scope 2 at $DIR/separate_const_switch.rs:17:23: 17:44
40         ((_2 as Break).0: usize) = move _7; // scope 2 at $DIR/separate_const_switch.rs:17:23: 17:44
41         discriminant(_2) = 1;            // scope 2 at $DIR/separate_const_switch.rs:17:23: 17:44
42         StorageDead(_7);                 // scope 2 at $DIR/separate_const_switch.rs:17:43: 17:44
43         StorageDead(_6);                 // scope 0 at $DIR/separate_const_switch.rs:17:43: 17:44
44         StorageLive(_10);                // scope 0 at $DIR/separate_const_switch.rs:21:28: 21:29
45         _10 = ((_2 as Break).0: usize);  // scope 0 at $DIR/separate_const_switch.rs:21:28: 21:29
46         Deinit(_0);                      // scope 4 at $DIR/separate_const_switch.rs:21:34: 21:38
47         discriminant(_0) = 0;            // scope 4 at $DIR/separate_const_switch.rs:21:34: 21:38
48         StorageDead(_10);                // scope 0 at $DIR/separate_const_switch.rs:21:37: 21:38
49         goto -> bb3;                     // scope 0 at $DIR/separate_const_switch.rs:21:37: 21:38
50     }
51
52     bb2: {
53         StorageLive(_4);                 // scope 0 at $DIR/separate_const_switch.rs:16:16: 16:17
54         _4 = ((_1 as Ok).0: i32);        // scope 0 at $DIR/separate_const_switch.rs:16:16: 16:17
55         StorageLive(_5);                 // scope 1 at $DIR/separate_const_switch.rs:16:44: 16:45
56         _5 = _4;                         // scope 1 at $DIR/separate_const_switch.rs:16:44: 16:45
57         Deinit(_2);                      // scope 1 at $DIR/separate_const_switch.rs:16:22: 16:46
58         ((_2 as Continue).0: i32) = move _5; // scope 1 at $DIR/separate_const_switch.rs:16:22: 16:46
59         discriminant(_2) = 0;            // scope 1 at $DIR/separate_const_switch.rs:16:22: 16:46
60         StorageDead(_5);                 // scope 1 at $DIR/separate_const_switch.rs:16:45: 16:46
61         StorageDead(_4);                 // scope 0 at $DIR/separate_const_switch.rs:16:45: 16:46
62         StorageLive(_8);                 // scope 0 at $DIR/separate_const_switch.rs:20:31: 20:32
63         _8 = ((_2 as Continue).0: i32);  // scope 0 at $DIR/separate_const_switch.rs:20:31: 20:32
64         StorageLive(_9);                 // scope 3 at $DIR/separate_const_switch.rs:20:42: 20:43
65         _9 = _8;                         // scope 3 at $DIR/separate_const_switch.rs:20:42: 20:43
66         Deinit(_0);                      // scope 3 at $DIR/separate_const_switch.rs:20:37: 20:44
67         ((_0 as Some).0: i32) = move _9; // scope 3 at $DIR/separate_const_switch.rs:20:37: 20:44
68         discriminant(_0) = 1;            // scope 3 at $DIR/separate_const_switch.rs:20:37: 20:44
69         StorageDead(_9);                 // scope 3 at $DIR/separate_const_switch.rs:20:43: 20:44
70         StorageDead(_8);                 // scope 0 at $DIR/separate_const_switch.rs:20:43: 20:44
71         goto -> bb3;                     // scope 0 at $DIR/separate_const_switch.rs:20:43: 20:44
72     }
73
74     bb3: {
75         StorageDead(_2);                 // scope 0 at $DIR/separate_const_switch.rs:23:1: 23:2
76         return;                          // scope 0 at $DIR/separate_const_switch.rs:23:2: 23:2
77     }
78 }