37 lines · plain
1# REQUIRES: x862# RUN: rm -rf %t; split-file %s %t3 4# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/foo.o %t/foo.s5# RUN: llvm-ar csr %t/lib.a %t/foo.o6 7# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/main.o %t/main.s8 9# RUN: %lld -lSystem %t/main.o %t/lib.a -o /dev/null -why_load | count 010 11# RUN: %lld -lSystem %t/main.o %t/lib.a -u _foo -o /dev/null -why_load | \12# RUN: FileCheck %s --check-prefix=FOO13 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=UNDEF16 17# RUN: %lld -lSystem %t/main.o %t/lib.a -u _asdf -undefined dynamic_lookup -o %t/dyn-lookup18# RUN: llvm-objdump --macho --syms %t/dyn-lookup | FileCheck %s --check-prefix=DYN19 20# FOO: _foo forced load of {{.+}}lib.a(foo.o)21# UNDEF: error: undefined symbol: _asdf22# UNDEF-NEXT: >>> referenced by -u23# UNDEF: error: undefined symbol: _fdsa24# UNDEF-NEXT: >>> referenced by -u25# DYN: *UND* _asdf26 27#--- foo.s28.globl _foo29_foo:30 ret31 32#--- main.s33.globl _main34_main:35 ret36 37