-
Notifications
You must be signed in to change notification settings - Fork 13k
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 #128562 - Oneirical:no-contest-expected, r=<try>
Migrate `incr-add-rust-src-component` and `issue-84395-lto-embed-bitcode` `run-make` tests to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). In `incr-add-rust-src-component`, I directly modify the sysroot, unlike the original test which used a symlink. This is probably a very bad idea, but I want to see what happens. try-job: x86_64-gnu-debug
- Loading branch information
Showing
6 changed files
with
51 additions
and
61 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 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 @@ | ||
// rust-lang/rust#70924: Test that if we add rust-src component in between | ||
// two incremental compiles, the compiler does not ICE on the second. | ||
// Remove the rust-src part of the sysroot for the *first* build. | ||
// Then put in a facsimile of the rust-src | ||
// component for the second build, in order to expose the ICE from issue #70924. | ||
// See https://github.com/rust-lang/rust/pull/72952 | ||
|
||
//FIXME(Oneirical): try on test-various and windows | ||
//FIXME(Oneirical): check that the direct edit of the sysroot is not messing things up | ||
|
||
use run_make_support::{path, rfs, rustc}; | ||
|
||
fn main() { | ||
let sysroot = rustc().print("sysroot").run().stdout_utf8(); | ||
let sysroot = sysroot.trim(); | ||
rfs::remove_dir_all(path(&sysroot).join("lib/rustlib/src/rust")); | ||
rustc().arg("--sysroot").arg(&sysroot).incremental("incr").input("main.rs").run(); | ||
rfs::create_dir_all(path(&sysroot).join("lib/rustlib/src/rust/src/libstd")); | ||
rfs::create_file(path(&sysroot).join("lib/rustlib/src/rust/src/libstd/lib.rs")); | ||
rustc().arg("--sysroot").arg(&sysroot).incremental("incr").input("main.rs").run(); | ||
} |
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,30 @@ | ||
// This test checks that the embed bitcode in elf created with | ||
// lto-embed-bitcode=optimized is a valid llvm bitcode module. | ||
// Otherwise, the `test.bc` file will cause an error when | ||
// `llvm-dis` attempts to disassemble it. | ||
// See https://github.com/rust-lang/rust/issues/84395 | ||
|
||
//@ needs-force-clang-based-tests | ||
// NOTE(#126180): This test only runs on `x86_64-gnu-debug`, because that CI job sets | ||
// RUSTBUILD_FORCE_CLANG_BASED_TESTS and only runs tests which contain "clang" in their | ||
// name. | ||
|
||
use run_make_support::llvm::llvm_bin_dir; | ||
use run_make_support::{cmd, env_var, rustc}; | ||
|
||
fn main() { | ||
rustc() | ||
.input("test.rs") | ||
.link_arg("-fuse-ld=lld") | ||
.arg("linker-plugin-lto") | ||
.linker(&env_var("CLANG")) | ||
.link_arg("-Wl,--plugin-opt=-lto-embed-bitcode=optimized") | ||
.arg("-Zemit-thin-lto=no") | ||
.run(); | ||
cmd(llvm_bin_dir().join("objcopy")) | ||
.arg("--dump-section") | ||
.arg(".llvmbc=test.bc") | ||
.arg("test") | ||
.run(); | ||
cmd(llvm_bin_dir().join("llvm-dis")).arg("test.bc").run(); | ||
} |
File renamed without changes.