Skip to content

Commit 5b49b68

Browse files
Migrate run-make/used to rmake.rs
1 parent 8217b41 commit 5b49b68

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
@@ -240,7 +240,6 @@ run-make/unknown-mod-stdin/Makefile
240240
run-make/unstable-flag-required/Makefile
241241
run-make/use-suggestions-rust-2018/Makefile
242242
run-make/used-cdylib-macos/Makefile
243-
run-make/used/Makefile
244243
run-make/volatile-intrinsics/Makefile
245244
run-make/wasm-exceptions-nostd/Makefile
246245
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)