summaryrefslogtreecommitdiff
path: root/lld/test/MachO/archive-no-index.s
blob: 37d28fda5c920c464550b33350468f286fd060e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# REQUIRES: x86

# RUN: rm -rf %t; split-file %s %t
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/main.o %t/main.s
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/lib.o %t/lib.s
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/lib2.o %t/lib2.s
# RUN: llvm-ar crST %t/lib.a %t/lib.o %t/lib2.o
# RUN: %lld %t/main.o %t/lib.a -o %t/out
# RUN: llvm-nm %t/out | FileCheck %s

# CHECK-NOT: T _bar
# CHECK:     T _foo

## Test that every kind of eager load mechanism still works.
# RUN: %lld %t/main.o %t/lib.a -all_load -o %t/all_load
# RUN: llvm-nm %t/all_load | FileCheck %s --check-prefix FORCED-LOAD
# RUN: %lld %t/main.o -force_load %t/lib.a -o %t/force_load
# RUN: llvm-nm %t/force_load | FileCheck %s --check-prefix FORCED-LOAD
# RUN: %lld %t/main.o %t/lib.a -ObjC -o %t/objc
# RUN: llvm-nm %t/objc | FileCheck %s --check-prefix FORCED-LOAD

# FORCED-LOAD: T _bar

#--- lib.s
.global _foo
_foo:
    ret

#--- lib2.s
.section __DATA,__objc_catlist
.quad 0x1234

.section __TEXT,__text
.global _bar
_bar:
    ret

#--- main.s
.global _main
_main:
    call _foo    
    mov $0, %rax
    ret