Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / MachO / u.s
blob59fb79689e8c6d8c1402586a967a85ffeed2e903
1 # REQUIRES: x86
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
25 # DYN: *UND* _asdf
27 #--- foo.s
28 .globl _foo
29 _foo:
30 ret
32 #--- main.s
33 .globl _main
34 _main:
35 ret