2 # RUN: rm -rf %t; split-file %s %t
4 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/foo.o %t/foo.s
5 # RUN: llvm-ar csr %t/lib.a %t/foo.o
7 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/main.o %t/main.s
9 # RUN: %lld -lSystem %t/main.o %t/lib.a -o /dev/null -why_load | count 0
11 # RUN: %lld -lSystem %t/main.o %t/lib.a -u _foo -o /dev/null -why_load | \
12 # RUN: FileCheck %s --check-prefix=FOO
14 # RUN: not %lld %t/main.o %t/lib.a -u _asdf -u _fdsa -o /dev/null 2>&1 | \
15 # RUN: FileCheck %s --check-prefix=UNDEF
17 # RUN: %lld -lSystem %t/main.o %t/lib.a -u _asdf -undefined dynamic_lookup -o %t/dyn-lookup
18 # RUN: llvm-objdump --macho --syms %t/dyn-lookup | FileCheck %s --check-prefix=DYN
20 # FOO: _foo forced load of {{.+}}lib.a(foo.o)
21 # UNDEF: error: undefined symbol: _asdf
22 # UNDEF-NEXT: >>> referenced by -u
23 # UNDEF: error: undefined symbol: _fdsa
24 # UNDEF-NEXT: >>> referenced by -u