forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#127926 - Oneirical:classical-orctestra, r=<try>
Migrate `foreign-double-unwind`, `issue-36710` and `foreign-exceptions` `run-make` tests to rmake Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). ~~This is expected to fail CI, I am getting a weird `core dumped` error on `foreign-double-unwind` locally. Posting this to start a discussion.~~ EDIT: I got it, `foreign_double_unwind` is *supposed* to fail in the execution stage, but this wasn't obvious, because the original test was just piping the stdout to `CGREP` (which silently ignores errors). try-job: aarch64-apple try-job: armhf-gnu try-job: test-various try-job: x86_64-msvc try-job: x86_64-gnu-llvm-18 try-job: i686-msvc try-job: dist-i586-gnu-i586-i686-musl
- Loading branch information
Showing
12 changed files
with
149 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Some start files were missed when originally writing the logic to swap in musl start files. | ||
// This caused #36710. After the fix in #50105, this test checks that linking to C++ code | ||
// with global destructors works. | ||
// See https://github.com/rust-lang/rust/pull/50105 | ||
|
||
//@ ignore-cross-compile | ||
// Reason: the compiled binary is executed | ||
|
||
// FIXME(Oneirical): are these really necessary? This test is supposed to test a musl | ||
// bug... and it ignores musl? This wasn't part of the original test at its creation, which | ||
// had no ignores. | ||
|
||
//# ignore-none no-std is not supported | ||
//# ignore-wasm32 FIXME: don't attempt to compile C++ to WASM | ||
//# ignore-wasm64 FIXME: don't attempt to compile C++ to WASM | ||
//# ignore-nvptx64-nvidia-cuda FIXME: can't find crate for `std` | ||
//# ignore-musl FIXME: this makefile needs teaching how to use a musl toolchain | ||
//# (see dist-i586-gnu-i586-i686-musl Dockerfile) | ||
//# ignore-sgx | ||
|
||
use run_make_support::{build_native_static_lib_cxx, run, rustc}; | ||
|
||
fn main() { | ||
build_native_static_lib_cxx("foo"); | ||
rustc().input("foo.rs").arg("-lfoo").extra_rs_cxx_flags().run(); | ||
run("foo"); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// When using foreign function interface (FFI) with C++, it is possible | ||
// to run into a "double unwind" if either both Rust and C++ run into a panic | ||
// and exception at the same time, or C++ encounters two exceptions. In this case, | ||
// one of the panic unwinds would be leaked and the other would be kept, leading | ||
// to undefined behaviour. After this was fixed in #92911, this test checks that | ||
// the keyword "unreachable" indicative of this bug triggering in this specific context | ||
// does not appear after successfully compiling and executing the program. | ||
// See https://github.com/rust-lang/rust/pull/92911 | ||
|
||
//@ needs-unwind | ||
// Reason: this test exercises panic unwinding | ||
//@ ignore-cross-compile | ||
// Reason: the compiled binary is executed | ||
|
||
use run_make_support::{build_native_static_lib_cxx, run_fail, rustc}; | ||
|
||
fn main() { | ||
build_native_static_lib_cxx("foo"); | ||
rustc().input("foo.rs").arg("-lfoo").extra_rs_cxx_flags().run(); | ||
run_fail("foo").assert_stdout_not_contains("unreachable"); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// This test was created to check that compilation and execution still works | ||
// after the addition of a new feature, in #65646: the ability to unwind panics | ||
// and exceptions back and forth between Rust and C++. Should this feature be broken, | ||
// the test should fail. | ||
// See https://github.com/rust-lang/rust/pull/65646 | ||
|
||
//@ needs-unwind | ||
// Reason: this test exercises panic unwinding | ||
//@ ignore-cross-compile | ||
// Reason: the compiled binary is executed | ||
|
||
use run_make_support::{build_native_static_lib_cxx, run, rustc}; | ||
|
||
fn main() { | ||
build_native_static_lib_cxx("foo"); | ||
rustc().input("foo.rs").arg("-lfoo").extra_rs_cxx_flags().run(); | ||
run("foo"); | ||
} |
This file was deleted.
Oops, something went wrong.