Skip to content

Commit

Permalink
Rollup merge of rust-lang#91373 - djkoloski:fuchsia_test_suite, r=Mar…
Browse files Browse the repository at this point in the history
…k-Simulacrum

Add needs-unwind to tests that depend on panicking

These tests were found by running the test suite on fuchsia which compiles with `panic=abort` by default, then picking through the failures manually to locate the tests that require unwinding support.

Most of these tests are already opted-out on platforms that compile with `panic=abort` by default. This just generalizes it a bit more so that fuchsia tests can be run properly. Currently, the `needs-unwind` directive needs to be manually passed to compiletest (e.g. via `--test-args '--target-panic=abort'`). Eventually, I would like `x.py` or compiletest to determine whether the directive should be used automatically based on the target panic settings.
  • Loading branch information
matthiaskrgr authored Dec 10, 2021
2 parents 0b42dea + ea68758 commit 7776a74
Show file tree
Hide file tree
Showing 62 changed files with 63 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/test/ui/array-slice-vec/box-of-array-of-drop-1.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
#![allow(overflowing_literals)]

// Test that we cleanup a fixed size Box<[D; k]> properly when D has a
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/array-slice-vec/box-of-array-of-drop-2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
#![allow(overflowing_literals)]

// Test that we cleanup dynamic sized Box<[D]> properly when D has a
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/array-slice-vec/nested-vec-3.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
#![allow(overflowing_literals)]

// ignore-emscripten no threads support
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/array-slice-vec/slice-panic-1.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind

// ignore-emscripten no threads support

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/array-slice-vec/slice-panic-2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind

// ignore-emscripten no threads support

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// be talking about `async fn`s instead. Should also test what happens when it panics.

// run-fail
// needs-unwind
// error-pattern: thread 'main' panicked at '`async fn` resumed after panicking'
// edition:2018
// ignore-wasm no panic or subprocess support
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// Check that partially moved from function parameters are dropped after the
// named bindings that move from them.

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/builtin-clone-unwind.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind

#![allow(unused_variables)]
#![allow(unused_imports)]
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/catch-unwind-bang.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-wasm32-bare compiled with panic=abort by default

fn worker() -> ! {
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/cleanup-rvalue-temp-during-incomplete-alloc.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind

#![allow(unused_must_use)]
#![allow(dead_code)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-rustfix
// needs-unwind

#![deny(rust_2021_incompatible_closure_captures)]
//~^ NOTE: the lint level is defined here
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-rustfix
// needs-unwind

#![deny(rust_2021_incompatible_closure_captures)]
//~^ NOTE: the lint level is defined here
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: changes to closure capture in Rust 2021 will affect which traits the closure implements
--> $DIR/mir_calls_to_shims.rs:20:38
--> $DIR/mir_calls_to_shims.rs:21:38
|
LL | let result = panic::catch_unwind(move || {
| ^^^^^^^
Expand All @@ -11,7 +11,7 @@ LL | f.0()
| --- in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.0`
|
note: the lint level is defined here
--> $DIR/mir_calls_to_shims.rs:3:9
--> $DIR/mir_calls_to_shims.rs:4:9
|
LL | #![deny(rust_2021_incompatible_closure_captures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/drop/drop-trait-enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#![allow(unused_assignments)]
#![allow(unused_variables)]
// ignore-emscripten no threads support
// needs-unwind

use std::thread;
use std::sync::mpsc::{channel, Sender};
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/drop/dynamic-drop-async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// * Dropping one of the values panics while dropping the future.

// run-pass
// needs-unwind
// edition:2018
// ignore-wasm32-bare compiled with panic=abort by default

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/drop/dynamic-drop.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-wasm32-bare compiled with panic=abort by default

#![feature(generators, generator_trait)]
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/drop/terminate-in-initializer.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-emscripten no threads support

// Issue #787
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten no threads support

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten no threads support

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/generator/generator-resume-after-panic.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-fail
// needs-unwind
// error-pattern:generator resumed after panicking
// ignore-emscripten no processes

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/generator/panic-drops-resume.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Tests that panics inside a generator will correctly drop the initial resume argument.
// run-pass
// needs-unwind
// ignore-wasm no unwind support
// ignore-emscripten no unwind support

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/generator/panic-drops.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind

// ignore-wasm32-bare compiled with panic=abort by default

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/generator/panic-safe.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind

// ignore-wasm32-bare compiled with panic=abort by default

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/generator/resume-after-return.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind

// ignore-wasm32-bare compiled with panic=abort by default

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/intrinsics/panic-uninitialized-zeroed.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-wasm32-bare compiled with panic=abort by default
// revisions: mir thir
// [thir]compile-flags: -Zthir-unsafeck
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/issues/issue-14875.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-wasm32-bare compiled with panic=abort by default

// Check that values are not leaked when a dtor panics (#14875)
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/issues/issue-25089.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-emscripten no threads support

use std::thread;
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/issues/issue-26655.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-emscripten no threads support

// Check that the destructors of simple enums are run on unwinding
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/issues/issue-29485.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// run-pass
#![allow(unused_attributes)]
// aux-build:issue-29485.rs
// needs-unwind
// ignore-emscripten no threads

#[feature(recover)]
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/issues/issue-29948.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-wasm32-bare compiled with panic=abort by default

use std::panic;
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/issues/issue-30018-panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// spawned thread to isolate the expected error result from the
// SIGTRAP injected by the drop-flag consistency checking.

// needs-unwind
// ignore-emscripten no threads support

struct Foo;
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/issues/issue-43853.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-wasm32-bare compiled with panic=abort by default

use std::panic;
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/issues/issue-46519.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// run-pass
// compile-flags:--test -O

// needs-unwind
// ignore-wasm32-bare compiled with panic=abort by default

#[test]
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/iterators/iter-count-overflow-debug.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass
// only-32bit too impatient for 2⁶⁴ items
// needs-unwind
// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: -C debug_assertions=yes -C opt-level=3

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/iterators/iter-position-overflow-debug.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass
// only-32bit too impatient for 2⁶⁴ items
// needs-unwind
// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: -C debug_assertions=yes -C opt-level=3

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/iterators/iter-step-overflow-debug.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: -C debug_assertions=yes

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/iterators/iter-sum-overflow-debug.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: -C debug_assertions=yes

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: -C overflow-checks

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/macros/macro-comma-behavior-rpass.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
#![allow(unused_imports)]
// Ideally, any macro call with a trailing comma should behave
// identically to a call without the comma.
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/mir/mir_calls_to_shims.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-wasm32-bare compiled with panic=abort by default

#![feature(fn_traits)]
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/mir/mir_drop_order.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-wasm32-bare compiled with panic=abort by default

use std::cell::RefCell;
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/mir/mir_drop_panics.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-fail
// needs-unwind
// error-pattern:panic 1
// error-pattern:drop 2
// ignore-emscripten no processes
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/mir/mir_dynamic_drops_3.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-fail
// needs-unwind
// error-pattern:unwind happens
// error-pattern:drop 3
// error-pattern:drop 2
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/numbers-arithmetic/int-abs-overflow.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// run-pass
// compile-flags: -C overflow-checks=on
// ignore-emscripten no threads support
// needs-unwind

use std::thread;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass
// compile-flags: -C debug_assertions=yes
// needs-unwind
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten dies with an LLVM error

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/panics/panic-handler-chain.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
#![allow(stable_features)]

// ignore-emscripten no threads support
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/panics/panic-handler-flail-wildly.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind

#![allow(stable_features)]
#![allow(unused_must_use)]
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/panics/panic-handler-set-twice.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
#![allow(unused_variables)]
#![allow(stable_features)]

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/panics/panic-in-dtor-drops-fields.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
#![allow(dead_code)]
#![allow(non_upper_case_globals)]

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/panics/panic-recover-propagate.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-emscripten no threads support

use std::sync::atomic::{AtomicUsize, Ordering};
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/privacy/reachable-unnameable-items.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass
// ignore-wasm32-bare compiled with panic=abort by default
// needs-unwind
// aux-build:reachable-unnameable-items.rs

extern crate reachable_unnameable_items;
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/proc-macro/expand-with-a-macro.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// aux-build:expand-with-a-macro.rs

// ignore-wasm32-bare compiled with panic=abort by default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// compile-flags: --test
// run-pass
// needs-unwind

// ignore-wasm32-bare compiled with panic=abort by default

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/rfc-2091-track-caller/std-panic-locations.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-wasm32-bare compiled with panic=abort by default
// revisions: default mir-opt
//[mir-opt] compile-flags: -Zmir-opt-level=4
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/rfcs/rfc1857-drop-order.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-wasm32-bare compiled with panic=abort by default

#![allow(dead_code, unreachable_code)]
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/runtime/rt-explody-panic-payloads.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-emscripten no processes
// ignore-sgx no processes
// ignore-wasm32-bare no unwinding panic
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/sepcomp/sepcomp-unwind.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
#![allow(dead_code)]
// compile-flags: -C codegen-units=3
// ignore-emscripten no threads support
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/structs-enums/unit-like-struct-drop-run.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-emscripten no threads support

// Make sure the destructor is run for unit-like structs.
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/test-attrs/test-should-fail-good-message.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind
// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: --test
#[test]
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/threads-sendsync/task-stderr.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass
// ignore-emscripten no threads support
// needs-unwind

#![feature(internal_output_capture)]

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/threads-sendsync/unwind-resource.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// run-pass
// needs-unwind

#![allow(non_camel_case_types)]
// ignore-emscripten no threads support
Expand Down
Loading

0 comments on commit 7776a74

Please sign in to comment.