From b564b70d1cb3678108f9045e8fcf2627270d544b Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Sat, 3 Aug 2024 12:26:50 +0000 Subject: [PATCH 1/2] Update run-make/used to use `any_symbol_contains` --- tests/run-make/used/rmake.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/run-make/used/rmake.rs b/tests/run-make/used/rmake.rs index 56ef5c6b9cc..eb5d026feda 100644 --- a/tests/run-make/used/rmake.rs +++ b/tests/run-make/used/rmake.rs @@ -4,12 +4,11 @@ // 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}; +use run_make_support::rustc; +use run_make_support::symbols::any_symbol_contains; fn main() { rustc().opt_level("3").emit("obj").input("used.rs").run(); - - cmd("nm").arg("used.o").run().assert_stdout_contains("FOO"); + assert!(any_symbol_contains("used.o", &["FOO"])); + assert!(!any_symbol_contains("used.o", &["BAR"])); } From eb451464a7557f2d8115183a92e6a300d20d75e5 Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Sat, 3 Aug 2024 13:01:34 +0000 Subject: [PATCH 2/2] Remove BAR for run-make/used.rs --- tests/run-make/used/rmake.rs | 1 - tests/run-make/used/used.rs | 2 -- 2 files changed, 3 deletions(-) diff --git a/tests/run-make/used/rmake.rs b/tests/run-make/used/rmake.rs index eb5d026feda..39f36b2eea8 100644 --- a/tests/run-make/used/rmake.rs +++ b/tests/run-make/used/rmake.rs @@ -10,5 +10,4 @@ use run_make_support::symbols::any_symbol_contains; fn main() { rustc().opt_level("3").emit("obj").input("used.rs").run(); assert!(any_symbol_contains("used.o", &["FOO"])); - assert!(!any_symbol_contains("used.o", &["BAR"])); } diff --git a/tests/run-make/used/used.rs b/tests/run-make/used/used.rs index dca0a5e1167..133f8121a8e 100644 --- a/tests/run-make/used/used.rs +++ b/tests/run-make/used/used.rs @@ -2,5 +2,3 @@ #[used] static FOO: u32 = 0; - -static BAR: u32 = 0;