2 # RUN: rm -rf %t; split-file %s %t
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/2.s -o %t/2.o
4 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/3.s -o %t/3.o
5 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/4.s -o %t/4.o
6 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/main.s -o %t/main.o
8 # RUN: llvm-ar rcs %t/test.a %t/2.o %t/3.o %t/4.o
9 # RUN: %lld %t/main.o %t/test.a -o %t/test.out
11 ## TODO: Run llvm-nm -p to validate symbol order
12 # RUN: llvm-nm %t/test.out | FileCheck %s
17 ## Linking with the archive first in the command line shouldn't change anything
18 # RUN: %lld %t/test.a %t/main.o -o %t/test.out
19 # RUN: llvm-nm %t/test.out | FileCheck %s --check-prefix ARCHIVE-FIRST
20 # ARCHIVE-FIRST: T _bar
21 # ARCHIVE-FIRST: T _boo
22 # ARCHIVE-FIRST: T _main
24 # RUN: llvm-nm %t/test.out | FileCheck %s --check-prefix VISIBLE
25 # VISIBLE-NOT: T _undefined
26 # VISIBLE-NOT: T _unused
28 # RUN: %lld %t/test.a %t/main.o -o %t/all-load -noall_load -all_load
29 # RUN: llvm-nm %t/all-load | FileCheck %s --check-prefix ALL-LOAD
35 # RUN: %lld %t/test.a %t/main.o -o %t/no-all-load -all_load -noall_load
36 # RUN: llvm-nm %t/no-all-load | FileCheck %s --check-prefix NO-ALL-LOAD
37 # RUN: %lld %t/test.a %t/main.o -o %t/no-all-load-only -noall_load
38 # RUN: llvm-nm %t/no-all-load-only | FileCheck %s --check-prefix NO-ALL-LOAD
39 # NO-ALL-LOAD-NOT: T _unused
41 ## Multiple archives defining the same symbols aren't an issue, due to lazy
43 # RUN: cp %t/test.a %t/test2.a
44 # RUN: %lld %t/test.a %t/test2.a %t/main.o -o /dev/null
57 .globl _undefined, _unused