File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 33// run-pass
44// needs-asm-support
55
6- #![ feature( asm, asm_unwind) ]
6+ #![ feature( asm, asm_sym , asm_unwind) ]
77
88use std:: panic:: { catch_unwind, resume_unwind, AssertUnwindSafe } ;
99
@@ -15,7 +15,6 @@ impl Drop for Foo<'_> {
1515 }
1616}
1717
18- #[ no_mangle]
1918extern "C" fn panicky ( ) {
2019 resume_unwind ( Box :: new ( ( ) ) ) ;
2120}
@@ -24,7 +23,14 @@ fn main() {
2423 let flag = & mut true ;
2524 catch_unwind ( AssertUnwindSafe ( || {
2625 let _foo = Foo ( flag) ;
27- unsafe { asm ! ( "bl _panicky" , clobber_abi( "C" ) , options( may_unwind) ) } ;
26+ unsafe {
27+ asm ! (
28+ "bl {}" ,
29+ sym panicky,
30+ clobber_abi( "C" ) ,
31+ options( may_unwind)
32+ ) ;
33+ }
2834 } ) )
2935 . expect_err ( "expected a panic" ) ;
3036 assert_eq ! ( * flag, false ) ;
Original file line number Diff line number Diff line change 33// run-pass
44// needs-asm-support
55
6- #![ feature( asm, asm_unwind) ]
6+ #![ feature( asm, asm_sym , asm_unwind) ]
77
88use std:: panic:: { catch_unwind, resume_unwind, AssertUnwindSafe } ;
99
@@ -15,7 +15,6 @@ impl Drop for Foo<'_> {
1515 }
1616}
1717
18- #[ no_mangle]
1918extern "C" fn panicky ( ) {
2019 resume_unwind ( Box :: new ( ( ) ) ) ;
2120}
@@ -24,7 +23,14 @@ fn main() {
2423 let flag = & mut true ;
2524 catch_unwind ( AssertUnwindSafe ( || {
2625 let _foo = Foo ( flag) ;
27- unsafe { asm ! ( "call panicky" , clobber_abi( "C" ) , options( may_unwind) ) } ;
26+ unsafe {
27+ asm ! (
28+ "call {}" ,
29+ sym panicky,
30+ clobber_abi( "C" ) ,
31+ options( may_unwind)
32+ ) ;
33+ }
2834 } ) )
2935 . expect_err ( "expected a panic" ) ;
3036 assert_eq ! ( * flag, false ) ;
You can’t perform that action at this time.
0 commit comments