2024-06-26 15:09:45 -05:00
|
|
|
// Symbols related to the allocator should be hidden and not exported from a cdylib,
|
|
|
|
// for they are internal to Rust
|
|
|
|
// and not part of the public ABI (application binary interface). This test checks that
|
|
|
|
// four such symbols are successfully hidden.
|
|
|
|
// See https://github.com/rust-lang/rust/pull/45710
|
|
|
|
|
2024-06-26 15:21:58 -05:00
|
|
|
//@ ignore-cross-compile
|
|
|
|
// Reason: The __rust_ symbol appears during cross-compilation.
|
2024-06-26 15:09:45 -05:00
|
|
|
|
|
|
|
use run_make_support::{dynamic_lib_name, llvm_readobj, rustc};
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
// Compile a cdylib
|
|
|
|
rustc().input("foo.rs").run();
|
2024-06-26 15:21:58 -05:00
|
|
|
let out =
|
|
|
|
llvm_readobj().arg("--dyn-symbols").input(dynamic_lib_name("foo")).run().stdout_utf8();
|
|
|
|
assert!(!&out.contains("__rdl_"), "{out}");
|
|
|
|
assert!(!&out.contains("__rde_"), "{out}");
|
|
|
|
assert!(!&out.contains("__rg_"), "{out}");
|
|
|
|
assert!(!&out.contains("__rust_"), "{out}");
|
2024-06-26 15:09:45 -05:00
|
|
|
}
|