-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rewrite and rename issue-84395-lto-embed-bitcode to rmake
- Loading branch information
Showing
5 changed files
with
32 additions
and
18 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 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.