Skip to content

Commit 2d0ef75

Browse files
Rollup merge of #125988 - GuillaumeGomez:migrate-run-make-used, r=jieyouxu
Migrate `run-make/used` to `rmake.rs` Part of #121876. r? `@jieyouxu`
2 parents c1f62a7 + 5b49b68 commit 2d0ef75

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ run-make/unknown-mod-stdin/Makefile
228228
run-make/unstable-flag-required/Makefile
229229
run-make/use-suggestions-rust-2018/Makefile
230230
run-make/used-cdylib-macos/Makefile
231-
run-make/used/Makefile
232231
run-make/volatile-intrinsics/Makefile
233232
run-make/wasm-exceptions-nostd/Makefile
234233
run-make/wasm-override-linker/Makefile

tests/run-make/used/Makefile

-7
This file was deleted.

tests/run-make/used/rmake.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// This test ensures that the compiler is keeping static variables, even if not referenced
2+
// by another part of the program, in the output object file.
3+
//
4+
// It comes from #39987 which implements this RFC for the #[used] attribute:
5+
// https://rust-lang.github.io/rfcs/2386-used.html
6+
7+
//@ ignore-msvc
8+
9+
use run_make_support::{cmd, rustc};
10+
11+
fn main() {
12+
rustc().opt_level("3").emit("obj").input("used.rs").run();
13+
14+
cmd("nm").arg("used.o").run().assert_stdout_contains("FOO");
15+
}

0 commit comments

Comments
 (0)