forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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=jie…
…youxu 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,26 @@ | ||
// 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 | ||
|
||
//@ ignore-none | ||
// Reason: no-std is not supported. | ||
//@ ignore-wasm32 | ||
//@ ignore-wasm64 | ||
// Reason: compiling C++ to WASM may cause problems. | ||
|
||
// Neither of these are tested in full CI. | ||
//@ ignore-nvptx64-nvidia-cuda | ||
// Reason: can't find crate "std" | ||
//@ 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,19 @@ | ||
// 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++. This is a basic smoke test, | ||
// this feature being broken in quiet or subtle ways could still result in this test | ||
// passing. | ||
// 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.