]>
git.proxmox.com Git - rustc.git/blob - src/test/mir-opt/uninhabited_enum_branching.rs
3 // test matching an enum with uninhabited variants
10 // test an enum where the discriminants don't match the variant indexes
11 // (the optimization should do nothing here)
19 Test1
::A(_
) => "A(Empty)",
20 Test1
::B(_
) => "B(Empty)",
32 // START rustc.main.UninhabitedEnumBranching.before.mir
47 // _3 = discriminant(_2);
48 // switchInt(move _3) -> [0isize: bb3, 1isize: bb4, 2isize: bb1, otherwise: bb2];
61 // _1 = const "A(Empty)";
66 // _4 = const "B(Empty)";
77 // _8 = discriminant(_7);
78 // switchInt(move _8) -> [4isize: bb8, 5isize: bb6, otherwise: bb7];
100 // END rustc.main.UninhabitedEnumBranching.before.mir
101 // START rustc.main.UninhabitedEnumBranching.after.mir
104 // let mut _2: Test1;
105 // let mut _3: isize;
109 // let mut _7: Test2;
110 // let mut _8: isize;
116 // _3 = discriminant(_2);
117 // switchInt(move _3) -> [2isize: bb1, otherwise: bb2];
130 // _1 = const "A(Empty)";
135 // _4 = const "B(Empty)";
146 // _8 = discriminant(_7);
147 // switchInt(move _8) -> [4isize: bb8, 5isize: bb6, otherwise: bb7];
169 // END rustc.main.UninhabitedEnumBranching.after.mir
170 // START rustc.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir
173 // let mut _2: Test1;
174 // let mut _3: isize;
178 // let mut _7: Test2;
179 // let mut _8: isize;
185 // _3 = discriminant(_2);
186 // switchInt(move _3) -> [2isize: bb1, otherwise: bb2];
198 // _8 = discriminant(_7);
199 // switchInt(move _8) -> [4isize: bb5, 5isize: bb3, otherwise: bb4];
224 // END rustc.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir