From 1215ea4849a47694ebacd288c1584b603c323bad Mon Sep 17 00:00:00 2001 From: Bryanskiy Date: Fri, 29 Jul 2022 12:00:14 +0300 Subject: [PATCH] add cdylib-bundled-split test --- src/test/run-make/native-link-modifier-bundle/Makefile | 8 ++++---- .../native-link-modifier-bundle/cdylib-bundled-split.rs | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 src/test/run-make/native-link-modifier-bundle/cdylib-bundled-split.rs diff --git a/src/test/run-make/native-link-modifier-bundle/Makefile b/src/test/run-make/native-link-modifier-bundle/Makefile index b7ee56ff52ec3..b9340457b34dc 100644 --- a/src/test/run-make/native-link-modifier-bundle/Makefile +++ b/src/test/run-make/native-link-modifier-bundle/Makefile @@ -7,7 +7,7 @@ # with the LLVM bitcode generated by rustc. NM = "$(LLVM_BIN_DIR)"/llvm-nm SPLIT = "-Zsplit-bundled-libs" -BUNDLED_LIB = "libbundled.rlib.bundle.native-staticlib.a" +BUNDLED_LIB = "libbundled_split.rlib.bundle.native-staticlib.a" all: $(call NATIVE_STATICLIB,native-staticlib) @@ -42,7 +42,7 @@ all: $(call NATIVE_STATICLIB,native-staticlib) $(NM) $(TMPDIR)/libbundled_split.rlib | $(CGREP) -ve "T _*native_func" $(NM) $(TMPDIR)/libbundled_split.rlib | $(CGREP) -e "U _*native_func" - # Build a cdylib, `native-staticlib` will appear on the linker line because it was not bundled previously + # Build a cdylib, 'BUNDLED_LIB' will appear on the linker line # The cdylib will contain the `native_func` symbol in the end - $(RUSTC) cdylib-non-bundled.rs --crate-type=cdylib --print link-args $(SPLIT) --crate-name=cdylib_non_bundled_split | $(CGREP) -e '-l[" ]*native-staticlib' - $(NM) $(call DYLIB,cdylib_non_bundled_split) | $(CGREP) -e "[Tt] _*native_func" \ No newline at end of file + $(RUSTC) cdylib-bundled-split.rs --crate-type=cdylib --print link-args $(SPLIT) | $(CGREP) -e $(BUNDLED_LIB) + $(NM) $(call DYLIB,cdylib_bundled_split) | $(CGREP) -e "[Tt] _*native_func" \ No newline at end of file diff --git a/src/test/run-make/native-link-modifier-bundle/cdylib-bundled-split.rs b/src/test/run-make/native-link-modifier-bundle/cdylib-bundled-split.rs new file mode 100644 index 0000000000000..f586f701cc5ba --- /dev/null +++ b/src/test/run-make/native-link-modifier-bundle/cdylib-bundled-split.rs @@ -0,0 +1 @@ +extern crate bundled_split;