[PATCH] D103812: [lld/mac] Add a test for -reexport_library + -dead_strip_dylibs

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 7 10:45:34 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG422544414b0d: [lld/mac] Add a test for -reexport_library + -dead_strip_dylibs (authored by thakis).
Herald added a project: LLVM.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103812/new/

https://reviews.llvm.org/D103812

Files:
  lld/test/MachO/dead-strip-dylibs.s


Index: lld/test/MachO/dead-strip-dylibs.s
===================================================================
--- lld/test/MachO/dead-strip-dylibs.s
+++ lld/test/MachO/dead-strip-dylibs.s
@@ -46,6 +46,14 @@
 # NOBARSTRIP: foo.dylib
 # NOBARSTRIP-NOT: bar-strip.dylib
 
+## Even libraries explicitly reexported with -reexport_library are stripped
+## if they are not referenced.
+# RUN: %lld -lSystem %t/main.o -o %t/main %t/foo_with_bar.dylib \
+# RUN:     -reexport_library %t/bar.dylib -dead_strip_dylibs
+# RUN: llvm-otool -L %t/main | FileCheck --check-prefix=NOBAR %s
+# RUN: llvm-otool -l %t/main | FileCheck --check-prefix=NOREEXPORT %s
+# NOREEXPORT-NOT: LC_REEXPORT_DYLIB
+
 ## But -needed_library and -needed-l win over -dead_strip_dylibs again.
 # RUN: %lld -lSystem %t/main.o -o %t/main %t/foo_with_bar.dylib \
 # RUN:     -needed_library %t/bar.dylib -dead_strip_dylibs


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103812.350358.patch
Type: text/x-patch
Size: 883 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210607/a308cc7a/attachment.bin>


More information about the llvm-commits mailing list