diff options
| author | Oneirical <manchot@videotron.ca> | 2024-06-26 16:21:58 -0400 |
|---|---|---|
| committer | Oneirical <manchot@videotron.ca> | 2024-07-09 14:30:57 -0400 |
| commit | d44732120cfd6f49d49bc333ad60c0539aedee19 (patch) | |
| tree | 1199542fe2e70df7a9750567cdff1b95058b9eaa /tests | |
| parent | 7c29298ea941247c13ef9de3f129802eb22f12b7 (diff) | |
| download | rust-d44732120cfd6f49d49bc333ad60c0539aedee19.tar.gz rust-d44732120cfd6f49d49bc333ad60c0539aedee19.zip | |
rewrite symbols-include-type-name to rmake
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run-make/cdylib-fewer-symbols/rmake.rs | 18 | ||||
| -rw-r--r-- | tests/run-make/extern-flag-pathless/rmake.rs | 3 | ||||
| -rw-r--r-- | tests/run-make/symbols-include-type-name/Makefile | 9 | ||||
| -rw-r--r-- | tests/run-make/symbols-include-type-name/rmake.rs | 12 |
4 files changed, 23 insertions, 19 deletions
diff --git a/tests/run-make/cdylib-fewer-symbols/rmake.rs b/tests/run-make/cdylib-fewer-symbols/rmake.rs index 8a8d31e6e49..da11f036f7c 100644 --- a/tests/run-make/cdylib-fewer-symbols/rmake.rs +++ b/tests/run-make/cdylib-fewer-symbols/rmake.rs @@ -4,20 +4,18 @@ // four such symbols are successfully hidden. // See https://github.com/rust-lang/rust/pull/45710 -//FIXME(Oneirical): try it on windows, restore ignore -// See https://github.com/rust-lang/rust/pull/46207#issuecomment-347561753 -//FIXME(Oneirical): I also removed cross-compile ignore since there is no binary execution +//@ ignore-cross-compile +// Reason: The __rust_ symbol appears during cross-compilation. use run_make_support::{dynamic_lib_name, llvm_readobj, rustc}; fn main() { // Compile a cdylib rustc().input("foo.rs").run(); - let out = llvm_readobj().arg("--symbols").input(dynamic_lib_name("foo")).run().stdout_utf8(); - let out = // All hidden symbols must be removed. - out.lines().filter(|&line| !line.trim().contains("HIDDEN")).collect::<Vec<_>>().join("\n"); - assert!(!&out.contains("__rdl_")); - assert!(!&out.contains("__rde_")); - assert!(!&out.contains("__rg_")); - assert!(!&out.contains("__ruse_")); + 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}"); } diff --git a/tests/run-make/extern-flag-pathless/rmake.rs b/tests/run-make/extern-flag-pathless/rmake.rs index 2f151136c33..9cf828abcb8 100644 --- a/tests/run-make/extern-flag-pathless/rmake.rs +++ b/tests/run-make/extern-flag-pathless/rmake.rs @@ -5,6 +5,9 @@ // respected. // See https://github.com/rust-lang/rust/pull/64882 +//@ ignore-cross-compile +// Reason: the compiled binary is executed + use run_make_support::{dynamic_lib_name, fs_wrapper, run, run_fail, rust_lib_name, rustc}; fn main() { diff --git a/tests/run-make/symbols-include-type-name/Makefile b/tests/run-make/symbols-include-type-name/Makefile deleted file mode 100644 index ac26a852e36..00000000000 --- a/tests/run-make/symbols-include-type-name/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -include ../tools.mk - -# Check that symbol names for methods include type names, instead of <impl>. - -OUT=$(TMPDIR)/lib.s - -all: - $(RUSTC) --crate-type staticlib --emit asm lib.rs - $(CGREP) Def < $(OUT) diff --git a/tests/run-make/symbols-include-type-name/rmake.rs b/tests/run-make/symbols-include-type-name/rmake.rs new file mode 100644 index 00000000000..746c7486bf0 --- /dev/null +++ b/tests/run-make/symbols-include-type-name/rmake.rs @@ -0,0 +1,12 @@ +// Method names used to be obfuscated when exported into symbols, +// leaving only an obscure `<impl>`. After the fix in #30328, +// this test checks that method names are successfully saved in the symbol list. +// See https://github.com/rust-lang/rust/issues/30260 + +use run_make_support::{invalid_utf8_contains, rustc}; + +fn main() { + rustc().crate_type("staticlib").emit("asm").input("lib.rs").run(); + // Check that symbol names for methods include type names, instead of <impl>. + invalid_utf8_contains("lib.s", "Def"); +} |
