diff --git a/src/test/ui/asm/aarch64/may_unwind.rs b/src/test/ui/asm/aarch64/may_unwind.rs index 05892ec8a209..94cc7d750491 100644 --- a/src/test/ui/asm/aarch64/may_unwind.rs +++ b/src/test/ui/asm/aarch64/may_unwind.rs @@ -3,7 +3,7 @@ // run-pass // needs-asm-support -#![feature(asm, asm_unwind)] +#![feature(asm, asm_sym, asm_unwind)] use std::panic::{catch_unwind, resume_unwind, AssertUnwindSafe}; @@ -15,7 +15,6 @@ impl Drop for Foo<'_> { } } -#[no_mangle] extern "C" fn panicky() { resume_unwind(Box::new(())); } @@ -24,7 +23,14 @@ fn main() { let flag = &mut true; catch_unwind(AssertUnwindSafe(|| { let _foo = Foo(flag); - unsafe { asm!("bl _panicky", clobber_abi("C"), options(may_unwind)) }; + unsafe { + asm!( + "bl {}", + sym panicky, + clobber_abi("C"), + options(may_unwind) + ); + } })) .expect_err("expected a panic"); assert_eq!(*flag, false); diff --git a/src/test/ui/asm/x86_64/may_unwind.rs b/src/test/ui/asm/x86_64/may_unwind.rs index 0d7c055fff83..5ac4dd9b956d 100644 --- a/src/test/ui/asm/x86_64/may_unwind.rs +++ b/src/test/ui/asm/x86_64/may_unwind.rs @@ -3,7 +3,7 @@ // run-pass // needs-asm-support -#![feature(asm, asm_unwind)] +#![feature(asm, asm_sym, asm_unwind)] use std::panic::{catch_unwind, resume_unwind, AssertUnwindSafe}; @@ -15,7 +15,6 @@ impl Drop for Foo<'_> { } } -#[no_mangle] extern "C" fn panicky() { resume_unwind(Box::new(())); } @@ -24,7 +23,14 @@ fn main() { let flag = &mut true; catch_unwind(AssertUnwindSafe(|| { let _foo = Foo(flag); - unsafe { asm!("call panicky", clobber_abi("C"), options(may_unwind)) }; + unsafe { + asm!( + "call {}", + sym panicky, + clobber_abi("C"), + options(may_unwind) + ); + } })) .expect_err("expected a panic"); assert_eq!(*flag, false);