1# REQUIRES: x86 2# RUN: rm -rf %t; split-file %s %t 3 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 6 7# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/main.o %t/main.s 8 9# RUN: %lld -lSystem %t/main.o %t/lib.a -o /dev/null -why_load | count 0 10 11# RUN: %lld -lSystem %t/main.o %t/lib.a -u _foo -o /dev/null -why_load | \ 12# RUN: FileCheck %s --check-prefix=FOO 13 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 16 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 19 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 25# DYN: *UND* _asdf 26 27#--- foo.s 28.globl _foo 29_foo: 30 ret 31 32#--- main.s 33.globl _main 34_main: 35 ret 36 37