[PATCH] D128025: [lld-macho][nfc] Tests for -force_load + regular archive load combinations

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 16 20:50:43 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG8eeede973c69: [lld-macho][nfc] Tests for -force_load + regular archive load combinations (authored by int3).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128025

Files:
  lld/test/MachO/force-load.s


Index: lld/test/MachO/force-load.s
===================================================================
--- lld/test/MachO/force-load.s
+++ lld/test/MachO/force-load.s
@@ -15,6 +15,16 @@
 # RUN: llvm-objdump --syms %t/test-force-load-second | FileCheck %s --check-prefix=FORCE-LOAD-SECOND
 # FORCE-LOAD-SECOND: __TEXT,obj _foo
 
+## If an archive has already been loaded w/o -force_load earlier in the command
+## line, a later -force_load argument will not have an effect.
+# RUN: %lld -lSystem %t/foo.a -force_load %t/foo.a %t/test.o -o %t/test-regular-then-force
+# RUN: llvm-objdump --syms %t/test-regular-then-force | FileCheck %s --check-prefix=REGULAR-THEN-FORCE
+# REGULAR-THEN-FORCE-NOT: _foo
+## If the -force_load comes first, then the second load will just be a no-op.
+# RUN: %lld -lSystem -force_load %t/foo.a %t/foo.a %t/test.o -o %t/test-force-then-regular
+# RUN: llvm-objdump --syms %t/test-regular-then-force | FileCheck %s --check-prefix=REGULAR-THEN-FORCE
+# FORCE-THEN-REGULAR: _foo
+
 ## Force-loading the same path twice is fine
 # RUN: %lld -lSystem %t/foo.o -force_load %t/foo.a -force_load %t/foo.a %t/test.o -o /dev/null
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128025.437785.patch
Type: text/x-patch
Size: 1150 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220617/ace8fdbb/attachment.bin>


More information about the llvm-commits mailing list