Change TerminatorKind::Abort to call the panic handler instead of

aborting immediately.

The panic handler is called with a special flag which forces it to abort
after calling the panic hook.
This commit is contained in:
Amanieu d'Antras 2022-01-12 20:45:31 +00:00
parent 528c4f9158
commit fe9dc6e62a
6 changed files with 60 additions and 6 deletions

View file

@ -9,7 +9,7 @@ extern "C-unwind" {
// CHECK: Function Attrs:{{.*}}nounwind
// CHECK-NEXT: define{{.*}}void @foo
// CHECK: call void @llvm.trap()
// CHECK: call void @_ZN4core9panicking15panic_no_unwind
#[no_mangle]
pub unsafe extern "C" fn foo() {
bar();