mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Rollup merge of #125988 - GuillaumeGomez:migrate-run-make-used, r=jieyouxu
Migrate `run-make/used` to `rmake.rs` Part of https://github.com/rust-lang/rust/issues/121876. r? `@jieyouxu`
This commit is contained in:
commit
2d0ef75867
@ -228,7 +228,6 @@ run-make/unknown-mod-stdin/Makefile
|
||||
run-make/unstable-flag-required/Makefile
|
||||
run-make/use-suggestions-rust-2018/Makefile
|
||||
run-make/used-cdylib-macos/Makefile
|
||||
run-make/used/Makefile
|
||||
run-make/volatile-intrinsics/Makefile
|
||||
run-make/wasm-exceptions-nostd/Makefile
|
||||
run-make/wasm-override-linker/Makefile
|
||||
|
@ -1,7 +0,0 @@
|
||||
include ../tools.mk
|
||||
|
||||
# ignore-windows-msvc
|
||||
|
||||
all:
|
||||
$(RUSTC) -C opt-level=3 --emit=obj used.rs
|
||||
nm $(TMPDIR)/used.o | $(CGREP) FOO
|
15
tests/run-make/used/rmake.rs
Normal file
15
tests/run-make/used/rmake.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// This test ensures that the compiler is keeping static variables, even if not referenced
|
||||
// by another part of the program, in the output object file.
|
||||
//
|
||||
// It comes from #39987 which implements this RFC for the #[used] attribute:
|
||||
// https://rust-lang.github.io/rfcs/2386-used.html
|
||||
|
||||
//@ ignore-msvc
|
||||
|
||||
use run_make_support::{cmd, rustc};
|
||||
|
||||
fn main() {
|
||||
rustc().opt_level("3").emit("obj").input("used.rs").run();
|
||||
|
||||
cmd("nm").arg("used.o").run().assert_stdout_contains("FOO");
|
||||
}
|
Loading…
Reference in New Issue
Block a user