add ignore-cross-compile to run-make test

This commit is contained in:
Folkert de Vries
2026-04-16 21:14:22 +02:00
parent 41afd5f8d6
commit 2db9de3782
2 changed files with 29 additions and 6 deletions
@@ -7,6 +7,16 @@ extern "C" fn used() {
naked_asm!("ret")
}
#[unsafe(no_mangle)]
extern "C" fn used_clothed() -> i32 {
41
}
pub fn main() {
std::hint::black_box(used());
std::hint::black_box(used_clothed());
}
#[unsafe(no_mangle)]
extern "C" fn unused_clothed() -> i32 {
42
@@ -36,7 +46,3 @@ extern "C" fn unused_link_section() {
extern "C" fn unused_link_section_clothed() -> i32 {
43
}
fn main() {
used();
}
@@ -1,13 +1,30 @@
//@ ignore-cross-compile
//@ needs-asm-support
use run_make_support::symbols::object_contains_any_symbol;
use run_make_support::{bin_name, rustc};
fn main() {
rustc().input("main.rs").opt().function_sections(true).run();
let bin = bin_name("main");
rustc().input("main.rs").opt().function_sections(false).run();
// Check that the naked symbol is eliminated when the "clothed" one is.
assert_eq!(
object_contains_any_symbol(&bin, &["unused_clothed"]),
object_contains_any_symbol(&bin, &["unused"])
);
assert_eq!(
object_contains_any_symbol(&bin, &["unused_link_section_clothed"]),
object_contains_any_symbol(&bin, &["unused_link_section"])
);
// ---
rustc().input("main.rs").opt().function_sections(true).run();
// Check that the naked symbol is eliminated when the "clothed" one is.
assert_eq!(