This commit is contained in:
Gary Guo 2022-10-07 18:01:17 +01:00
parent 242348343b
commit fc83427066
2 changed files with 11 additions and 10 deletions

View File

@ -1,6 +1,7 @@
// Tests inlining of `may_unwind` inline assembly. // Tests inlining of `may_unwind` inline assembly.
// //
// ignore-wasm32-bare compiled with panic=abort by default // ignore-wasm32-bare compiled with panic=abort by default
// needs-asm-support
#![feature(asm_unwind)] #![feature(asm_unwind)]
struct D; struct D;

View File

@ -4,10 +4,10 @@
fn main() -> () { fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/asm-unwind.rs:+0:15: +0:15 let mut _0: (); // return place in scope 0 at $DIR/asm-unwind.rs:+0:15: +0:15
let _1: (); // in scope 0 at $DIR/asm-unwind.rs:+1:5: +1:10 let _1: (); // in scope 0 at $DIR/asm-unwind.rs:+1:5: +1:10
+ scope 1 (inlined foo) { // at $DIR/asm-unwind.rs:20:5: 20:10 + scope 1 (inlined foo) { // at $DIR/asm-unwind.rs:21:5: 21:10
+ let _2: D; // in scope 1 at $DIR/asm-unwind.rs:14:9: 14:11 + let _2: D; // in scope 1 at $DIR/asm-unwind.rs:15:9: 15:11
+ scope 2 { + scope 2 {
+ debug _d => _2; // in scope 2 at $DIR/asm-unwind.rs:14:9: 14:11 + debug _d => _2; // in scope 2 at $DIR/asm-unwind.rs:15:9: 15:11
+ scope 3 { + scope 3 {
+ } + }
+ } + }
@ -17,29 +17,29 @@
StorageLive(_1); // scope 0 at $DIR/asm-unwind.rs:+1:5: +1:10 StorageLive(_1); // scope 0 at $DIR/asm-unwind.rs:+1:5: +1:10
- _1 = foo() -> bb1; // scope 0 at $DIR/asm-unwind.rs:+1:5: +1:10 - _1 = foo() -> bb1; // scope 0 at $DIR/asm-unwind.rs:+1:5: +1:10
- // mir::Constant - // mir::Constant
- // + span: $DIR/asm-unwind.rs:20:5: 20:8 - // + span: $DIR/asm-unwind.rs:21:5: 21:8
- // + literal: Const { ty: fn() {foo}, val: Value(<ZST>) } - // + literal: Const { ty: fn() {foo}, val: Value(<ZST>) }
+ StorageLive(_2); // scope 1 at $DIR/asm-unwind.rs:14:9: 14:11 + StorageLive(_2); // scope 1 at $DIR/asm-unwind.rs:15:9: 15:11
+ asm!("", options(MAY_UNWIND)) -> [return: bb1, unwind: bb3]; // scope 3 at $DIR/asm-unwind.rs:15:14: 15:54 + asm!("", options(MAY_UNWIND)) -> [return: bb1, unwind: bb3]; // scope 3 at $DIR/asm-unwind.rs:16:14: 16:54
} }
bb1: { bb1: {
+ drop(_2) -> bb2; // scope 1 at $DIR/asm-unwind.rs:16:1: 16:2 + drop(_2) -> bb2; // scope 1 at $DIR/asm-unwind.rs:17:1: 17:2
+ } + }
+ +
+ bb2: { + bb2: {
+ StorageDead(_2); // scope 1 at $DIR/asm-unwind.rs:16:1: 16:2 + StorageDead(_2); // scope 1 at $DIR/asm-unwind.rs:17:1: 17:2
StorageDead(_1); // scope 0 at $DIR/asm-unwind.rs:+1:10: +1:11 StorageDead(_1); // scope 0 at $DIR/asm-unwind.rs:+1:10: +1:11
_0 = const (); // scope 0 at $DIR/asm-unwind.rs:+0:15: +2:2 _0 = const (); // scope 0 at $DIR/asm-unwind.rs:+0:15: +2:2
return; // scope 0 at $DIR/asm-unwind.rs:+2:2: +2:2 return; // scope 0 at $DIR/asm-unwind.rs:+2:2: +2:2
+ } + }
+ +
+ bb3 (cleanup): { + bb3 (cleanup): {
+ drop(_2) -> bb4; // scope 1 at $DIR/asm-unwind.rs:16:1: 16:2 + drop(_2) -> bb4; // scope 1 at $DIR/asm-unwind.rs:17:1: 17:2
+ } + }
+ +
+ bb4 (cleanup): { + bb4 (cleanup): {
+ resume; // scope 1 at $DIR/asm-unwind.rs:13:1: 16:2 + resume; // scope 1 at $DIR/asm-unwind.rs:14:1: 17:2
} }
} }