File tree Expand file tree Collapse file tree 3 files changed +23
-16
lines changed
tests/run-make/cdylib-fewer-symbols Expand file tree Collapse file tree 3 files changed +23
-16
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ run-make/c-unwind-abi-catch-lib-panic/Makefile
99run-make/c-unwind-abi-catch-panic/Makefile
1010run-make/cat-and-grep-sanity-check/Makefile
1111run-make/cdylib-dylib-linkage/Makefile
12- run-make/cdylib-fewer-symbols/Makefile
1312run-make/compiler-lookup-paths-2/Makefile
1413run-make/compiler-lookup-paths/Makefile
1514run-make/compiler-rt-works-on-mingw/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ // Symbols related to the allocator should be hidden and not exported from a cdylib,
2+ // for they are internal to Rust
3+ // and not part of the public ABI (application binary interface). This test checks that
4+ // four such symbols are successfully hidden.
5+ // See https://github.com/rust-lang/rust/pull/45710
6+
7+ //FIXME(Oneirical): try it on windows, restore ignore
8+ // See https://github.com/rust-lang/rust/pull/46207#issuecomment-347561753
9+ //FIXME(Oneirical): I also removed cross-compile ignore since there is no binary execution
10+
11+ use run_make_support:: { dynamic_lib_name, llvm_readobj, rustc} ;
12+
13+ fn main ( ) {
14+ // Compile a cdylib
15+ rustc ( ) . input ( "foo.rs" ) . run ( ) ;
16+ let out = llvm_readobj ( ) . arg ( "--symbols" ) . input ( dynamic_lib_name ( "foo" ) ) . run ( ) . stdout_utf8 ( ) ;
17+ let out = // All hidden symbols must be removed.
18+ out. lines ( ) . filter ( |& line| !line. trim ( ) . contains ( "HIDDEN" ) ) . collect :: < Vec < _ > > ( ) . join ( "\n " ) ;
19+ assert ! ( !& out. contains( "__rdl_" ) ) ;
20+ assert ! ( !& out. contains( "__rde_" ) ) ;
21+ assert ! ( !& out. contains( "__rg_" ) ) ;
22+ assert ! ( !& out. contains( "__ruse_" ) ) ;
23+ }
You can’t perform that action at this time.
0 commit comments