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 3
3
// run-pass
4
4
// needs-asm-support
5
5
6
- #![ feature( asm, asm_unwind) ]
6
+ #![ feature( asm, asm_sym , asm_unwind) ]
7
7
8
8
use std:: panic:: { catch_unwind, resume_unwind, AssertUnwindSafe } ;
9
9
@@ -15,7 +15,6 @@ impl Drop for Foo<'_> {
15
15
}
16
16
}
17
17
18
- #[ no_mangle]
19
18
extern "C" fn panicky ( ) {
20
19
resume_unwind ( Box :: new ( ( ) ) ) ;
21
20
}
@@ -24,7 +23,14 @@ fn main() {
24
23
let flag = & mut true ;
25
24
catch_unwind ( AssertUnwindSafe ( || {
26
25
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
+ }
28
34
} ) )
29
35
. expect_err ( "expected a panic" ) ;
30
36
assert_eq ! ( * flag, false ) ;
Original file line number Diff line number Diff line change 3
3
// run-pass
4
4
// needs-asm-support
5
5
6
- #![ feature( asm, asm_unwind) ]
6
+ #![ feature( asm, asm_sym , asm_unwind) ]
7
7
8
8
use std:: panic:: { catch_unwind, resume_unwind, AssertUnwindSafe } ;
9
9
@@ -15,7 +15,6 @@ impl Drop for Foo<'_> {
15
15
}
16
16
}
17
17
18
- #[ no_mangle]
19
18
extern "C" fn panicky ( ) {
20
19
resume_unwind ( Box :: new ( ( ) ) ) ;
21
20
}
@@ -24,7 +23,14 @@ fn main() {
24
23
let flag = & mut true ;
25
24
catch_unwind ( AssertUnwindSafe ( || {
26
25
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
+ }
28
34
} ) )
29
35
. expect_err ( "expected a panic" ) ;
30
36
assert_eq ! ( * flag, false ) ;
You can’t perform that action at this time.
0 commit comments