Skip to content

Commit 68eaebb

Browse files
committed
rewrite and rename issue-84395-lto-embed-bitcode to rmake
1 parent 07ce2de commit 68eaebb

File tree

5 files changed

+32
-17
lines changed

5 files changed

+32
-17
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ run-make/extern-fn-reachable/Makefile
1212
run-make/foreign-double-unwind/Makefile
1313
run-make/foreign-exceptions/Makefile
1414
run-make/issue-36710/Makefile
15-
run-make/issue-84395-lto-embed-bitcode/Makefile
1615
run-make/issue-88756-default-output/Makefile
1716
run-make/jobserver-error/Makefile
1817
run-make/libs-through-symlinks/Makefile

tests/run-make/incr-add-rust-src-component/rmake.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// rust-lang/rust#70924: Test that if we add rust-src component in between two
2-
// incremental compiles, the compiler does not ICE on the second.
1+
// rust-lang/rust#70924: Test that if we add rust-src component in between
2+
// two incremental compiles, the compiler does not ICE on the second.
33
// Remove the rust-src part of the sysroot for the *first* build.
44
// Then put in a facsimile of the rust-src
55
// component for the second build, in order to expose the ICE from issue #70924.

tests/run-make/issue-84395-lto-embed-bitcode/Makefile

-14
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// This test checks that the embed bitcode in elf created with
2+
// lto-embed-bitcode=optimized is a valid llvm bitcode module.
3+
// Otherwise, the `test.bc` file will cause an error when
4+
// `llvm-dis` attempts to disassemble it.
5+
// See https://github.com/rust-lang/rust/issues/84395
6+
7+
//@ needs-force-clang-based-tests
8+
// NOTE(#126180): This test only runs on `x86_64-gnu-debug`, because that CI job sets
9+
// RUSTBUILD_FORCE_CLANG_BASED_TESTS and only runs tests which contain "clang" in their
10+
// name.
11+
12+
use run_make_support::llvm::llvm_bin_dir;
13+
use run_make_support::{cmd, env_var, rustc};
14+
15+
fn main() {
16+
rustc()
17+
.input("test.rs")
18+
.link_arg("-fuse-ld=lld")
19+
.arg("linker-plugin-lto")
20+
.linker(&env_var("CLANG"))
21+
.link_arg("-Wl,--plugin-opt=-lto-embed-bitcode=optimized")
22+
.arg("-Zemit-thin-lto=no")
23+
.run();
24+
cmd(llvm_bin_dir().join("objcopy"))
25+
.arg("--dump-section")
26+
.arg(".llvmbc=test.bc")
27+
.arg("test")
28+
.run();
29+
cmd(llvm_bin_dir().join("llvm-dis")).arg("test.bc").run();
30+
}

0 commit comments

Comments
 (0)