[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / lld / test / MachO / order-file.s
blobe0ca735abdbff93241350cd8a2ce7082609ceae7
1 # REQUIRES: x86
2 # RUN: rm -rf %t; split-file %s %t
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o
4 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo.s -o %t/foo.o
5 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/abs.s -o %t/abs.o
6 # RUN: llvm-ar rcs %t/foo.a %t/foo.o
8 # FOO-FIRST: <_bar>:
9 # FOO-FIRST: <_main>:
11 # FOO-SECOND: <_main>:
12 # FOO-SECOND: <_bar>:
14 # RUN: %lld -lSystem -o %t/test-1 %t/test.o %t/foo.o -order_file %t/ord-1
15 # RUN: llvm-objdump -d %t/test-1 | FileCheck %s --check-prefix=FOO-FIRST
16 ## Output should be the same regardless of the command-line order of object files
17 # RUN: %lld -lSystem -o %t/test-1 %t/foo.o %t/test.o -order_file %t/ord-1
18 # RUN: llvm-objdump -d %t/test-1 | FileCheck %s --check-prefix=FOO-FIRST
20 # RUN: %lld -lSystem -o %t/test-2 %t/test.o %t/foo.o -order_file %t/ord-2
21 # RUN: llvm-objdump -d %t/test-2 | FileCheck %s --check-prefix=FOO-SECOND
22 # RUN: %lld -lSystem -o %t/test-2 %t/foo.o %t/test.o -order_file %t/ord-2
23 # RUN: llvm-objdump -d %t/test-2 | FileCheck %s --check-prefix=FOO-SECOND
25 # RUN: %lld -lSystem -o %t/test-file-match %t/test.o %t/foo.o -order_file %t/ord-file-match
26 # RUN: llvm-objdump -d %t/test-file-match | FileCheck %s --check-prefix=FOO-FIRST
27 ## Output should be the same regardless of the command-line order of object files
28 # RUN: %lld -lSystem -o %t/test-file-match %t/foo.o %t/test.o -order_file %t/ord-file-match
29 # RUN: llvm-objdump -d %t/test-file-match | FileCheck %s --check-prefix=FOO-FIRST
31 # RUN: %lld -lSystem -o %t/test-file-nomatch %t/test.o %t/foo.o -order_file %t/ord-file-nomatch
32 # RUN: llvm-objdump -d %t/test-file-nomatch | FileCheck %s --check-prefix=FOO-SECOND
33 # RUN: %lld -lSystem -o %t/test-file-nomatch %t/foo.o %t/test.o -order_file %t/ord-file-nomatch
34 # RUN: llvm-objdump -d %t/test-file-nomatch | FileCheck %s --check-prefix=FOO-SECOND
36 # RUN: %lld -lSystem -o %t/test-arch-match %t/test.o %t/foo.o -order_file %t/ord-arch-match
37 # RUN: llvm-objdump -d %t/test-arch-match | FileCheck %s --check-prefix=FOO-FIRST
38 # RUN: %lld -lSystem -o %t/test-arch-match %t/foo.o %t/test.o -order_file %t/ord-arch-match
39 # RUN: llvm-objdump -d %t/test-arch-match | FileCheck %s --check-prefix=FOO-FIRST
41 # RUN: %lld -lSystem -o %t/test-arch-nomatch %t/test.o %t/foo.o -order_file %t/ord-arch-nomatch
42 # RUN: llvm-objdump -d %t/test-arch-nomatch | FileCheck %s --check-prefix=FOO-SECOND
43 # RUN: %lld -lSystem -o %t/test-arch-nomatch %t/foo.o %t/test.o -order_file %t/ord-arch-nomatch
44 # RUN: llvm-objdump -d %t/test-arch-nomatch | FileCheck %s --check-prefix=FOO-SECOND
46 # RUN: %lld -lSystem -o %t/test-arch-match %t/test.o %t/foo.o -order_file %t/ord-arch-match
47 # RUN: llvm-objdump -d %t/test-arch-match | FileCheck %s --check-prefix=FOO-FIRST
48 # RUN: %lld -lSystem -o %t/test-arch-match %t/foo.o %t/test.o -order_file %t/ord-arch-match
49 # RUN: llvm-objdump -d %t/test-arch-match | FileCheck %s --check-prefix=FOO-FIRST
51 ## Test archives
53 # RUN: %lld -lSystem -o %t/test-archive-1 %t/test.o %t/foo.a -order_file %t/ord-1
54 # RUN: llvm-objdump -d %t/test-archive-1 | FileCheck %s --check-prefix=FOO-FIRST
55 # RUN: %lld -lSystem -o %t/test-archive-1 %t/foo.a %t/test.o -order_file %t/ord-1
56 # RUN: llvm-objdump -d %t/test-archive-1 | FileCheck %s --check-prefix=FOO-FIRST
58 # RUN: %lld -lSystem -o %t/test-archive-file-no-match %t/test.o %t/foo.a -order_file %t/ord-file-match
59 # RUN: llvm-objdump -d %t/test-archive-file-no-match | FileCheck %s --check-prefix=FOO-SECOND
60 # RUN: %lld -lSystem -o %t/test-archive %t/foo.a %t/test.o -order_file %t/ord-file-match
61 # RUN: llvm-objdump -d %t/test-archive-file-no-match | FileCheck %s --check-prefix=FOO-SECOND
63 # RUN: %lld -lSystem -o %t/test-archive-1 %t/test.o %t/foo.a -order_file %t/ord-archive-match
64 # RUN: llvm-objdump -d %t/test-archive-1 | FileCheck %s --check-prefix=FOO-FIRST
65 # RUN: %lld -lSystem -o %t/test-archive-1 %t/foo.a %t/test.o -order_file %t/ord-archive-match
66 # RUN: llvm-objdump -d %t/test-archive-1 | FileCheck %s --check-prefix=FOO-FIRST
68 # RUN: %lld -lSystem -o %t/test-archive-file-no-match %t/test.o %t/foo.a -order_file %t/ord-file-nomatch
69 # RUN: llvm-objdump -d %t/test-archive-file-no-match | FileCheck %s --check-prefix=FOO-SECOND
70 # RUN: %lld -lSystem -o %t/test-archive %t/foo.a %t/test.o -order_file %t/ord-file-nomatch
71 # RUN: llvm-objdump -d %t/test-archive-file-no-match | FileCheck %s --check-prefix=FOO-SECOND
73 ## The following tests check that if an address is matched by multiple order
74 ## file entries, it should always use the lowest-ordered match.
76 # RUN: %lld -lSystem -o %t/test-1 %t/test.o %t/foo.o -order_file %t/ord-multiple-1
77 # RUN: llvm-objdump -d %t/test-1 | FileCheck %s --check-prefix=FOO-FIRST
78 # RUN: %lld -lSystem -o %t/test-1 %t/foo.o %t/test.o -order_file %t/ord-multiple-1
79 # RUN: llvm-objdump -d %t/test-1 | FileCheck %s --check-prefix=FOO-FIRST
81 # RUN: %lld -lSystem -o %t/test-2 %t/test.o %t/foo.o -order_file %t/ord-multiple-2
82 # RUN: llvm-objdump -d %t/test-2 | FileCheck %s --check-prefix=FOO-FIRST
83 # RUN: %lld -lSystem -o %t/test-2 %t/foo.o %t/test.o -order_file %t/ord-multiple-2
84 # RUN: llvm-objdump -d %t/test-2 | FileCheck %s --check-prefix=FOO-FIRST
86 # RUN: %lld -lSystem -o %t/test-3 %t/test.o %t/foo.o -order_file %t/ord-multiple-3
87 # RUN: llvm-objdump -d %t/test-3 | FileCheck %s --check-prefix=FOO-FIRST
88 # RUN: %lld -lSystem -o %t/test-3 %t/foo.o %t/test.o -order_file %t/ord-multiple-3
89 # RUN: llvm-objdump -d %t/test-3 | FileCheck %s --check-prefix=FOO-FIRST
91 # RUN: %lld -lSystem -o %t/test-4 %t/test.o %t/foo.o -order_file %t/ord-multiple-4
92 # RUN: llvm-objdump -d %t/test-4 | FileCheck %s --check-prefix=FOO-FIRST
93 # RUN: %lld -lSystem -o %t/test-4 %t/foo.o %t/test.o -order_file %t/ord-multiple-4
94 # RUN: llvm-objdump -d %t/test-4 | FileCheck %s --check-prefix=FOO-FIRST
96 ## -[Foo doFoo:andBar:] and _bar both point to the same location. When both
97 ## symbols appear in an order file, the location in question should be ordered
98 ## according to the lowest-ordered symbol that references it.
100 # RUN: %lld -lSystem -o %t/test-alias %t/test.o %t/foo.o -order_file %t/ord-alias
101 # RUN: llvm-objdump -d %t/test-alias | FileCheck %s --check-prefix=FOO-FIRST
102 # RUN: %lld -lSystem -o %t/test-alias %t/foo.o %t/test.o -order_file %t/ord-alias
103 # RUN: llvm-objdump -d %t/test-alias | FileCheck %s --check-prefix=FOO-FIRST
105 ## Absolute in symbols in order files make no sense. Just ignore them.
106 # RUN: %lld -lSystem -dylib -o %t/test-abs %t/abs.o -order_file %t/ord-abs
108 #--- ord-1
109 -[Foo doFoo:andBar:] # just a comment
110 _main # another comment
112 #--- ord-2
113 _main # just a comment
114 -[Foo doFoo:andBar:] # another comment
116 #--- ord-file-match
117 foo.o:-[Foo doFoo:andBar:]
118 _main
120 #--- ord-archive-match
121 foo.a(foo.o):-[Foo doFoo:andBar:]
122 _main
124 #--- ord-file-nomatch
125 bar.o:-[Foo doFoo:andBar:]
126 _main
127 -[Foo doFoo:andBar:]
129 #--- ord-arch-match
130 x86_64:-[Foo doFoo:andBar:]
131 _main
133 #--- ord-arch-nomatch
134 arm64:-[Foo doFoo:andBar:]
135 _main
136 -[Foo doFoo:andBar:]
138 #--- ord-arch-file-match
139 x86_64:bar.o:-[Foo doFoo:andBar:]
140 _main
142 #--- ord-multiple-1
143 -[Foo doFoo:andBar:]
144 _main
145 foo.o:-[Foo doFoo:andBar:]
147 #--- ord-multiple-2
148 foo.o:-[Foo doFoo:andBar:]
149 _main
150 -[Foo doFoo:andBar:]
152 #--- ord-multiple-3
153 -[Foo doFoo:andBar:]
154 _main
155 -[Foo doFoo:andBar:]
157 #--- ord-multiple-4
158 foo.o:-[Foo doFoo:andBar:]
159 _main
160 foo.o:-[Foo doFoo:andBar:]
162 #--- ord-alias
163 _bar
164 _main
165 -[Foo doFoo:andBar:]
167 #--- ord-abs
168 _abs
170 #--- foo.s
171 .globl "-[Foo doFoo:andBar:]"
172 "-[Foo doFoo:andBar:]":
173 _bar:
176 #--- test.s
177 .globl _main
179 _main:
180 callq "-[Foo doFoo:andBar:]"
183 .section __DWARF,__debug_aranges,regular,debug
184 ltmp1:
185 .byte 0
187 #--- abs.s
188 _abs = 42