From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/panic-runtime/auxiliary/depends.rs | 8 ++++++++ .../panic-runtime/auxiliary/exit-success-if-unwind.rs | 16 ++++++++++++++++ src/test/ui/panic-runtime/auxiliary/needs-abort.rs | 5 +++++ .../ui/panic-runtime/auxiliary/needs-panic-runtime.rs | 6 ++++++ src/test/ui/panic-runtime/auxiliary/needs-unwind.rs | 13 +++++++++++++ .../ui/panic-runtime/auxiliary/panic-runtime-abort.rs | 17 +++++++++++++++++ .../panic-runtime/auxiliary/panic-runtime-lang-items.rs | 15 +++++++++++++++ .../ui/panic-runtime/auxiliary/panic-runtime-unwind.rs | 17 +++++++++++++++++ .../ui/panic-runtime/auxiliary/panic-runtime-unwind2.rs | 17 +++++++++++++++++ .../auxiliary/wants-panic-runtime-abort.rs | 7 +++++++ .../auxiliary/wants-panic-runtime-unwind.rs | 6 ++++++ 11 files changed, 127 insertions(+) create mode 100644 src/test/ui/panic-runtime/auxiliary/depends.rs create mode 100644 src/test/ui/panic-runtime/auxiliary/exit-success-if-unwind.rs create mode 100644 src/test/ui/panic-runtime/auxiliary/needs-abort.rs create mode 100644 src/test/ui/panic-runtime/auxiliary/needs-panic-runtime.rs create mode 100644 src/test/ui/panic-runtime/auxiliary/needs-unwind.rs create mode 100644 src/test/ui/panic-runtime/auxiliary/panic-runtime-abort.rs create mode 100644 src/test/ui/panic-runtime/auxiliary/panic-runtime-lang-items.rs create mode 100644 src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind.rs create mode 100644 src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind2.rs create mode 100644 src/test/ui/panic-runtime/auxiliary/wants-panic-runtime-abort.rs create mode 100644 src/test/ui/panic-runtime/auxiliary/wants-panic-runtime-unwind.rs (limited to 'src/test/ui/panic-runtime/auxiliary') diff --git a/src/test/ui/panic-runtime/auxiliary/depends.rs b/src/test/ui/panic-runtime/auxiliary/depends.rs new file mode 100644 index 000000000..e9bc2f489 --- /dev/null +++ b/src/test/ui/panic-runtime/auxiliary/depends.rs @@ -0,0 +1,8 @@ +// no-prefer-dynamic + +#![feature(panic_runtime)] +#![crate_type = "rlib"] +#![panic_runtime] +#![no_std] + +extern crate needs_panic_runtime; diff --git a/src/test/ui/panic-runtime/auxiliary/exit-success-if-unwind.rs b/src/test/ui/panic-runtime/auxiliary/exit-success-if-unwind.rs new file mode 100644 index 000000000..c0e057405 --- /dev/null +++ b/src/test/ui/panic-runtime/auxiliary/exit-success-if-unwind.rs @@ -0,0 +1,16 @@ +// no-prefer-dynamic + +#![crate_type = "rlib"] + +struct Bomb; + +impl Drop for Bomb { + fn drop(&mut self) { + std::process::exit(0); + } +} + +pub fn bar(f: fn()) { + let _bomb = Bomb; + f(); +} diff --git a/src/test/ui/panic-runtime/auxiliary/needs-abort.rs b/src/test/ui/panic-runtime/auxiliary/needs-abort.rs new file mode 100644 index 000000000..8fad49b5e --- /dev/null +++ b/src/test/ui/panic-runtime/auxiliary/needs-abort.rs @@ -0,0 +1,5 @@ +// compile-flags:-C panic=abort +// no-prefer-dynamic + +#![crate_type = "rlib"] +#![no_std] diff --git a/src/test/ui/panic-runtime/auxiliary/needs-panic-runtime.rs b/src/test/ui/panic-runtime/auxiliary/needs-panic-runtime.rs new file mode 100644 index 000000000..3f030c169 --- /dev/null +++ b/src/test/ui/panic-runtime/auxiliary/needs-panic-runtime.rs @@ -0,0 +1,6 @@ +// no-prefer-dynamic + +#![feature(needs_panic_runtime)] +#![crate_type = "rlib"] +#![needs_panic_runtime] +#![no_std] diff --git a/src/test/ui/panic-runtime/auxiliary/needs-unwind.rs b/src/test/ui/panic-runtime/auxiliary/needs-unwind.rs new file mode 100644 index 000000000..d555b5319 --- /dev/null +++ b/src/test/ui/panic-runtime/auxiliary/needs-unwind.rs @@ -0,0 +1,13 @@ +// compile-flags:-C panic=unwind +// no-prefer-dynamic + +#![crate_type = "rlib"] +#![no_std] +#![feature(c_unwind)] + +extern "C-unwind" fn foo() {} + +fn bar() { + let ptr: extern "C-unwind" fn() = foo; + ptr(); +} diff --git a/src/test/ui/panic-runtime/auxiliary/panic-runtime-abort.rs b/src/test/ui/panic-runtime/auxiliary/panic-runtime-abort.rs new file mode 100644 index 000000000..c92015eee --- /dev/null +++ b/src/test/ui/panic-runtime/auxiliary/panic-runtime-abort.rs @@ -0,0 +1,17 @@ +// compile-flags:-C panic=abort +// no-prefer-dynamic + +#![feature(panic_runtime)] +#![crate_type = "rlib"] + +#![no_std] +#![panic_runtime] + +#[no_mangle] +pub extern "C" fn __rust_maybe_catch_panic() {} + +#[no_mangle] +pub extern "C" fn __rust_start_panic() {} + +#[no_mangle] +pub extern "C" fn rust_eh_personality() {} diff --git a/src/test/ui/panic-runtime/auxiliary/panic-runtime-lang-items.rs b/src/test/ui/panic-runtime/auxiliary/panic-runtime-lang-items.rs new file mode 100644 index 000000000..b9ef2f329 --- /dev/null +++ b/src/test/ui/panic-runtime/auxiliary/panic-runtime-lang-items.rs @@ -0,0 +1,15 @@ +// no-prefer-dynamic + +#![crate_type = "rlib"] + +#![no_std] +#![feature(lang_items)] + +use core::panic::PanicInfo; + +#[lang = "panic_impl"] +fn panic_impl(info: &PanicInfo) -> ! { loop {} } +#[lang = "eh_personality"] +fn eh_personality() {} +#[lang = "eh_catch_typeinfo"] +static EH_CATCH_TYPEINFO: u8 = 0; diff --git a/src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind.rs b/src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind.rs new file mode 100644 index 000000000..2f7aed924 --- /dev/null +++ b/src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind.rs @@ -0,0 +1,17 @@ +// compile-flags:-C panic=unwind +// no-prefer-dynamic + +#![feature(panic_runtime)] +#![crate_type = "rlib"] + +#![no_std] +#![panic_runtime] + +#[no_mangle] +pub extern "C" fn __rust_maybe_catch_panic() {} + +#[no_mangle] +pub extern "C" fn __rust_start_panic() {} + +#[no_mangle] +pub extern "C" fn rust_eh_personality() {} diff --git a/src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind2.rs b/src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind2.rs new file mode 100644 index 000000000..2f7aed924 --- /dev/null +++ b/src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind2.rs @@ -0,0 +1,17 @@ +// compile-flags:-C panic=unwind +// no-prefer-dynamic + +#![feature(panic_runtime)] +#![crate_type = "rlib"] + +#![no_std] +#![panic_runtime] + +#[no_mangle] +pub extern "C" fn __rust_maybe_catch_panic() {} + +#[no_mangle] +pub extern "C" fn __rust_start_panic() {} + +#[no_mangle] +pub extern "C" fn rust_eh_personality() {} diff --git a/src/test/ui/panic-runtime/auxiliary/wants-panic-runtime-abort.rs b/src/test/ui/panic-runtime/auxiliary/wants-panic-runtime-abort.rs new file mode 100644 index 000000000..3c0d2d658 --- /dev/null +++ b/src/test/ui/panic-runtime/auxiliary/wants-panic-runtime-abort.rs @@ -0,0 +1,7 @@ +// compile-flags:-C panic=abort +// no-prefer-dynamic + +#![crate_type = "rlib"] +#![no_std] + +extern crate panic_runtime_abort; diff --git a/src/test/ui/panic-runtime/auxiliary/wants-panic-runtime-unwind.rs b/src/test/ui/panic-runtime/auxiliary/wants-panic-runtime-unwind.rs new file mode 100644 index 000000000..d5f010219 --- /dev/null +++ b/src/test/ui/panic-runtime/auxiliary/wants-panic-runtime-unwind.rs @@ -0,0 +1,6 @@ +// no-prefer-dynamic + +#![crate_type = "rlib"] +#![no_std] + +extern crate panic_runtime_unwind; -- cgit v1.2.3