mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
add ignore-cross-compile to run-make test
This commit is contained in:
@@ -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!(
|
||||
|
||||
Reference in New Issue
Block a user