Skip to content

Commit

Permalink
add cdylib-bundled-split test
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryanskiy committed Jul 29, 2022
1 parent 8d09ef9 commit 1215ea4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/test/run-make/native-link-modifier-bundle/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"
$(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"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extern crate bundled_split;

0 comments on commit 1215ea4

Please sign in to comment.