Skip to content

Commit d447321

Browse files
committed
rewrite symbols-include-type-name to rmake
1 parent 7c29298 commit d447321

File tree

5 files changed

+23
-20
lines changed

5 files changed

+23
-20
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ run-make/staticlib-dylib-linkage/Makefile
170170
run-make/std-core-cycle/Makefile
171171
run-make/symbol-mangling-hashed/Makefile
172172
run-make/symbol-visibility/Makefile
173-
run-make/symbols-include-type-name/Makefile
174173
run-make/sysroot-crates-are-unstable/Makefile
175174
run-make/target-cpu-native/Makefile
176175
run-make/target-specs/Makefile

tests/run-make/cdylib-fewer-symbols/rmake.rs

+8-10
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,18 @@
44
// four such symbols are successfully hidden.
55
// See https://github.com/rust-lang/rust/pull/45710
66

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
7+
//@ ignore-cross-compile
8+
// Reason: The __rust_ symbol appears during cross-compilation.
109

1110
use run_make_support::{dynamic_lib_name, llvm_readobj, rustc};
1211

1312
fn main() {
1413
// Compile a cdylib
1514
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_"));
15+
let out =
16+
llvm_readobj().arg("--dyn-symbols").input(dynamic_lib_name("foo")).run().stdout_utf8();
17+
assert!(!&out.contains("__rdl_"), "{out}");
18+
assert!(!&out.contains("__rde_"), "{out}");
19+
assert!(!&out.contains("__rg_"), "{out}");
20+
assert!(!&out.contains("__rust_"), "{out}");
2321
}

tests/run-make/extern-flag-pathless/rmake.rs

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
// respected.
66
// See https://github.com/rust-lang/rust/pull/64882
77

8+
//@ ignore-cross-compile
9+
// Reason: the compiled binary is executed
10+
811
use run_make_support::{dynamic_lib_name, fs_wrapper, run, run_fail, rust_lib_name, rustc};
912

1013
fn main() {

tests/run-make/symbols-include-type-name/Makefile

-9
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Method names used to be obfuscated when exported into symbols,
2+
// leaving only an obscure `<impl>`. After the fix in #30328,
3+
// this test checks that method names are successfully saved in the symbol list.
4+
// See https://github.com/rust-lang/rust/issues/30260
5+
6+
use run_make_support::{invalid_utf8_contains, rustc};
7+
8+
fn main() {
9+
rustc().crate_type("staticlib").emit("asm").input("lib.rs").run();
10+
// Check that symbol names for methods include type names, instead of <impl>.
11+
invalid_utf8_contains("lib.s", "Def");
12+
}

0 commit comments

Comments
 (0)