1 RUN: ld.lld -### foo.o -m i386pe 2>&1 | FileCheck -check-prefix=X86 %s
4 X86-SAME: -alternatename:__image_base__=___ImageBase
7 RUN: echo "-### foo.o -m i386pe" > %t.rsp
8 RUN: ld.lld @%t.rsp 2>&1 | FileCheck -check-prefix=X86 %s
10 RUN: ld.lld -### foo.o -m i386pep 2>&1 | FileCheck -check-prefix=X64 %s
12 X64-SAME: -machine:x64
13 X64-SAME: -alternatename:__image_base__=__ImageBase
16 RUN: ld.lld -### foo.o -m thumb2pe 2>&1 | FileCheck -check-prefix=ARM %s
18 ARM-SAME: -machine:arm
19 ARM-SAME: -alternatename:__image_base__=__ImageBase
22 RUN: ld.lld -### foo.o -m arm64pe 2>&1 | FileCheck -check-prefix=ARM64 %s
24 ARM64-SAME: -machine:arm64
25 ARM64-SAME: -alternatename:__image_base__=__ImageBase
28 RUN: ld.lld -### foo.o -m i386pep -shared 2>&1 | FileCheck -check-prefix=SHARED %s
29 RUN: ld.lld -### foo.o -m i386pep --shared 2>&1 | FileCheck -check-prefix=SHARED %s
30 RUN: ld.lld -### foo.o -m i386pep --dll 2>&1 | FileCheck -check-prefix=SHARED %s
34 RUN: ld.lld -### foo.o -m i386pep -shared foo.def 2>&1 | FileCheck -check-prefix=DEF1 %s
37 RUN: ld.lld -### foo.o -m i386pep -shared FOO.DEF 2>&1 | FileCheck -check-prefix=DEF2 %s
40 RUN: ld.lld -### foo.o -m i386pep -obar.exe 2>&1 | FileCheck -check-prefix=OUT %s
41 RUN: ld.lld -### foo.o -m i386pep -o bar.exe 2>&1 | FileCheck -check-prefix=OUT %s
44 RUN: ld.lld -### foo.o -m i386pep --out-implib bar 2>&1 | FileCheck -check-prefix=IMPLIB %s
45 RUN: ld.lld -### foo.o -m i386pep --out-implib=bar 2>&1 | FileCheck -check-prefix=IMPLIB %s
46 RUN: ld.lld -### foo.o -m i386pep -out-implib bar 2>&1 | FileCheck -check-prefix=IMPLIB %s
47 RUN: ld.lld -### foo.o -m i386pep -out-implib=bar 2>&1 | FileCheck -check-prefix=IMPLIB %s
50 RUN: ld.lld -### foo.o -m i386pep -e bar 2>&1 | FileCheck -check-prefix=ENTRY %s
51 RUN: ld.lld -### foo.o -m i386pep -ebar 2>&1 | FileCheck -check-prefix=ENTRY %s
52 RUN: ld.lld -### foo.o -m i386pep -entry bar 2>&1 | FileCheck -check-prefix=ENTRY %s
53 RUN: ld.lld -### foo.o -m i386pep --entry bar 2>&1 | FileCheck -check-prefix=ENTRY %s
54 RUN: ld.lld -### foo.o -m i386pep -entry=bar 2>&1 | FileCheck -check-prefix=ENTRY %s
55 RUN: ld.lld -### foo.o -m i386pep --entry=bar 2>&1 | FileCheck -check-prefix=ENTRY %s
58 RUN: ld.lld -### foo.o -m i386pep -mllvm bar -mllvm baz 2>&1 | FileCheck -check-prefix=MLLVM %s
59 MLLVM: -mllvm:bar -mllvm:baz
61 RUN: ld.lld -### foo.o -m i386pep -subsystem console 2>&1 | FileCheck -check-prefix=SUBSYSTEM %s
62 RUN: ld.lld -### foo.o -m i386pep --subsystem console 2>&1 | FileCheck -check-prefix=SUBSYSTEM %s
63 RUN: ld.lld -### foo.o -m i386pep -subsystem=console 2>&1 | FileCheck -check-prefix=SUBSYSTEM %s
64 RUN: ld.lld -### foo.o -m i386pep --subsystem=console 2>&1 | FileCheck -check-prefix=SUBSYSTEM %s
65 SUBSYSTEM: -subsystem:console
67 RUN: ld.lld -### foo.o -m i386pep --major-os-version 7 --minor-os-version 8 2>&1 | FileCheck -check-prefix=OS_VERSION %s
68 RUN: ld.lld -### foo.o -m i386pep --major-os-version=7 --minor-os-version=8 2>&1 | FileCheck -check-prefix=OS_VERSION %s
69 OS_VERSION: -osversion:7.8 -subsystem:default,6.0
71 RUN: ld.lld -### foo.o -m i386pep --major-subsystem-version 7 --minor-subsystem-version 8 2>&1 | FileCheck -check-prefix=SUBSYSTEM_VERSION %s
72 RUN: ld.lld -### foo.o -m i386pep --major-subsystem-version=7 --minor-subsystem-version=8 2>&1 | FileCheck -check-prefix=SUBSYSTEM_VERSION %s
73 SUBSYSTEM_VERSION: -osversion:6.0 -subsystem:default,7.8
75 RUN: ld.lld -### foo.o -m i386pep --minor-subsystem-version 8 2>&1 | FileCheck -check-prefix=SUBSYSTEM_DEFAULT_MAJOR %s
76 SUBSYSTEM_DEFAULT_MAJOR: -subsystem:default,6.8
78 RUN: ld.lld -### foo.o -m i386pep --major-subsystem-version 7 2>&1 | FileCheck -check-prefix=SUBSYSTEM_DEFAULT_MINOR %s
79 SUBSYSTEM_DEFAULT_MINOR: -subsystem:default,7.0
81 RUN: ld.lld -### foo.o -m i386pep --subsystem windows --major-subsystem-version 7 --minor-subsystem-version 8 2>&1 | FileCheck -check-prefix=SUBSYSTEM_WINDOWS %s
82 RUN: ld.lld -### foo.o -m i386pep --major-subsystem-version 7 --minor-subsystem-version 8 --subsystem windows 2>&1 | FileCheck -check-prefix=SUBSYSTEM_WINDOWS %s
83 RUN: ld.lld -### foo.o -m i386pep --subsystem windows:7.8 2>&1 | FileCheck -check-prefix=SUBSYSTEM_WINDOWS %s
84 RUN: ld.lld -### foo.o -m i386pep --subsystem windows:2.3 --major-subsystem-version 7 --minor-subsystem-version 8 2>&1 | FileCheck -check-prefix=SUBSYSTEM_WINDOWS %s
85 RUN: ld.lld -### foo.o -m i386pep --subsystem windows:7.8 2>&1 | FileCheck -check-prefix=SUBSYSTEM_WINDOWS %s
86 RUN: ld.lld -### foo.o -m i386pep --major-subsystem-version 2 --minor-subsystem-version 3 --subsystem windows:7.8 2>&1 | FileCheck -check-prefix=SUBSYSTEM_WINDOWS %s
87 RUN: ld.lld -### foo.o -m i386pep --major-subsystem-version 2 --minor-subsystem-version 8 --subsystem windows:7 2>&1 | FileCheck -check-prefix=SUBSYSTEM_WINDOWS %s
88 SUBSYSTEM_WINDOWS: -subsystem:windows,7.8
90 RUN: ld.lld -### foo.o -m i386pep -stack 4194304,8192 2>&1 | FileCheck -check-prefix=STACK %s
91 RUN: ld.lld -### foo.o -m i386pep --stack 4194304,8192 2>&1 | FileCheck -check-prefix=STACK %s
92 RUN: ld.lld -### foo.o -m i386pep --stack=4194304,8192 2>&1 | FileCheck -check-prefix=STACK %s
93 STACK: -stack:4194304,8192
95 RUN: ld.lld -### foo.o -m i386pep -verbose 2>&1 | FileCheck -check-prefix=VERBOSE %s
96 RUN: ld.lld -### foo.o -m i386pep --verbose 2>&1 | FileCheck -check-prefix=VERBOSE %s
99 RUN: ld.lld -### -shared -m i386pe -e _DllMainCRTStartup@12 foo.o 2>&1 | FileCheck -check-prefix I386-ENTRY %s
100 I386-ENTRY: -entry:DllMainCRTStartup@12
102 RUN: ld.lld -### -m i386pep foo.o --whole-archive bar.a --no-whole-archive baz.a 2>&1 | FileCheck -check-prefix WHOLE-ARCHIVE %s
103 RUN: ld.lld -### -m i386pep foo.o -whole-archive bar.a -no-whole-archive baz.a 2>&1 | FileCheck -check-prefix WHOLE-ARCHIVE %s
104 WHOLE-ARCHIVE: foo.o -wholearchive:bar.a baz.a
106 RUN: ld.lld -### -m i386pep foo.o 2>&1 | FileCheck -check-prefix MINGW-FLAG %s
107 MINGW-FLAG: lld-link -lldmingw
109 RUN: ld.lld -### -m i386pep foo.o --exclude-all-symbols 2>&1 | FileCheck -check-prefix EXCLUDE-ALL %s
110 RUN: ld.lld -### -m i386pep foo.o -exclude-all-symbols 2>&1 | FileCheck -check-prefix EXCLUDE-ALL %s
111 EXCLUDE-ALL: -exclude-all-symbols
113 RUN: ld.lld -### -m i386pep foo.o --export-all-symbols 2>&1 | FileCheck -check-prefix EXPORT-ALL %s
114 RUN: ld.lld -### -m i386pep foo.o -export-all-symbols 2>&1 | FileCheck -check-prefix EXPORT-ALL %s
115 EXPORT-ALL: -export-all-symbols
117 RUN: ld.lld -### -m i386pep foo.o --output-def out.def 2>&1 | FileCheck -check-prefix OUTPUT-DEF %s
118 RUN: ld.lld -### -m i386pep foo.o --output-def=out.def 2>&1 | FileCheck -check-prefix OUTPUT-DEF %s
119 RUN: ld.lld -### -m i386pep foo.o -output-def out.def 2>&1 | FileCheck -check-prefix OUTPUT-DEF %s
120 RUN: ld.lld -### -m i386pep foo.o -output-def=out.def 2>&1 | FileCheck -check-prefix OUTPUT-DEF %s
121 OUTPUT-DEF: -output-def:out.def
123 RUN: ld.lld -### -m i386pep foo.o -Xlink=-lldmap 2>&1 | FileCheck -check-prefix XLINK %s
126 RUN: ld.lld -### -m i386pep foo.o 2>&1 | FileCheck -check-prefix DEBUG %s
129 RUN: ld.lld -### -m i386pep foo.o -s 2>&1 | FileCheck -check-prefix STRIP %s
130 RUN: ld.lld -### -m i386pep foo.o --strip-all 2>&1 | FileCheck -check-prefix STRIP %s
131 STRIP-NOT: -debug:dwarf
133 RUN: ld.lld -### -m i386pep foo.o -S 2>&1 | FileCheck -check-prefix STRIP-DEBUG %s
134 RUN: ld.lld -### -m i386pep foo.o --strip-debug 2>&1 | FileCheck -check-prefix STRIP-DEBUG %s
135 STRIP-DEBUG: -debug:symtab
136 STRIP-DEBUG-NOT: -debug:dwarf
138 RUN: ld.lld -### -m i386pep foo.o -pdb out.pdb 2>&1 | FileCheck -check-prefix PDB %s
139 RUN: ld.lld -### -m i386pep foo.o -pdb=out.pdb 2>&1 | FileCheck -check-prefix PDB %s
140 PDB: -debug -pdb:out.pdb
141 PDB-NOT: -debug:dwarf
143 RUN: ld.lld -### -m i386pep foo.o -pdb= 2>&1 | FileCheck -check-prefix PDB-DEFAULT %s
145 PDB-DEFAULT-NOT: -pdb:{{.*}}
147 RUN: ld.lld -### -m i386pep foo.o --large-address-aware 2>&1 | FileCheck -check-prefix LARGE-ADDRESS-AWARE %s
148 LARGE-ADDRESS-AWARE: -largeaddressaware
150 RUN: ld.lld -### -m i386pe foo.o --dynamicbase --no-dynamicbase 2>&1 | FileCheck -check-prefix DISABLE-DYNAMICBASE %s
151 RUN: ld.lld -### -m i386pe foo.o --dynamicbase --disable-dynamicbase 2>&1 | FileCheck -check-prefix DISABLE-DYNAMICBASE %s
152 DISABLE-DYNAMICBASE: -dynamicbase:no
153 RUN: ld.lld -### -m i386pe --disable-dynamicbase --dynamicbase foo.o 2>&1 | FileCheck -check-prefix NO-DISABLE-DYNAMICBASE %s
154 RUN: ld.lld -### -m i386pep -dynamicbase foo.o 2>&1 | FileCheck -check-prefix NO-DISABLE-DYNAMICBASE %s
155 RUN: ld.lld -### -m i386pe foo.o 2>&1 | FileCheck -check-prefix NO-DISABLE-DYNAMICBASE %s
156 RUN: ld.lld -### -m i386pep foo.o 2>&1 | FileCheck -check-prefix NO-DISABLE-DYNAMICBASE %s
157 RUN: ld.lld -### -m thumb2pe foo.o 2>&1 | FileCheck -check-prefix NO-DISABLE-DYNAMICBASE %s
158 RUN: ld.lld -### -m arm64pe foo.o 2>&1 | FileCheck -check-prefix NO-DISABLE-DYNAMICBASE %s
159 # On arm, dynamicbase can't be disabled, so --no-dynamicbase is ignored
160 RUN: ld.lld -### -m thumb2pe foo.o --no-dynamicbase 2>&1 | FileCheck -check-prefix NO-DISABLE-DYNAMICBASE %s
161 RUN: ld.lld -### -m arm64pe foo.o --no-dynamicbase 2>&1 | FileCheck -check-prefix NO-DISABLE-DYNAMICBASE %s
162 NO-DISABLE-DYNAMICBASE-NOT: -dynamicbase:no
164 RUN: ld.lld -### -m i386pe foo.o -high-entropy-va -disable-high-entropy-va 2>&1 | FileCheck -check-prefix DISABLE-HIGH-ENTROPY-VA %s
165 RUN: ld.lld -### -m i386pe foo.o --high-entropy-va --disable-high-entropy-va 2>&1 | FileCheck -check-prefix DISABLE-HIGH-ENTROPY-VA %s
166 DISABLE-HIGH-ENTROPY-VA: -highentropyva:no
167 RUN: ld.lld -### -m i386pe foo.o -disable-high-entropy-va -high-entropy-va 2>&1 | FileCheck -check-prefix NO-DISABLE-HIGH-ENTROPY-VA %s
168 RUN: ld.lld -### -m i386pe foo.o --disable-high-entropy-va --high-entropy-va 2>&1 | FileCheck -check-prefix NO-DISABLE-HIGH-ENTROPY-VA %s
169 NO-DISABLE-HIGH-ENTROPY-VA-NOT: -highentropyva:no
171 RUN: ld.lld -### -m i386pe foo.o -nxcompat -disable-nxcompat 2>&1 | FileCheck -check-prefix DISABLE-NXCOMPAT %s
172 RUN: ld.lld -### -m i386pe foo.o --nxcompat --disable-nxcompat 2>&1 | FileCheck -check-prefix DISABLE-NXCOMPAT %s
173 DISABLE-NXCOMPAT: -nxcompat:no
174 RUN: ld.lld -### -m i386pe foo.o -disable-nxcompat -nxcompat 2>&1 | FileCheck -check-prefix NO-DISABLE-NXCOMPAT %s
175 RUN: ld.lld -### -m i386pe foo.o --disable-nxcompat --nxcompat 2>&1 | FileCheck -check-prefix NO-DISABLE-NXCOMPAT %s
176 NO-DISABLE-NXCOMPAT-NOT: -nxcompat:no
178 RUN: ld.lld -### -m i386pe foo.o -tsaware -disable-tsaware 2>&1 | FileCheck -check-prefix DISABLE-TSAWARE %s
179 RUN: ld.lld -### -m i386pe foo.o --tsaware --disable-tsaware 2>&1 | FileCheck -check-prefix DISABLE-TSAWARE %s
180 DISABLE-TSAWARE: -tsaware:no
181 RUN: ld.lld -### -m i386pe foo.o -disable-tsaware -tsaware 2>&1 | FileCheck -check-prefix NO-DISABLE-TSAWARE %s
182 RUN: ld.lld -### -m i386pe foo.o --disable-tsaware --tsaware 2>&1 | FileCheck -check-prefix NO-DISABLE-TSAWARE %s
183 NO-DISABLE-TSAWARE-NOT: -tsaware:no
185 RUN: ld.lld -### -m i386pe foo.o -enable-reloc-section -disable-reloc-section 2>&1 | FileCheck -check-prefix DISABLE-RELOC-SECTION %s
186 RUN: ld.lld -### -m i386pe foo.o --enable-reloc-section --disable-reloc-section 2>&1 | FileCheck -check-prefix DISABLE-RELOC-SECTION %s
187 DISABLE-RELOC-SECTION: -fixed{{ }}
188 RUN: ld.lld -### -m i386pe foo.o -disable-reloc-section -enable-reloc-section 2>&1 | FileCheck -check-prefix NO-DISABLE-RELOC-SECTION %s
189 RUN: ld.lld -### -m i386pe foo.o --disable-reloc-section --enable-reloc-section 2>&1 | FileCheck -check-prefix NO-DISABLE-RELOC-SECTION %s
190 NO-DISABLE-RELOC-SECTION-NOT: -fixed
192 RUN: ld.lld -### -m i386pep foo.o --image-base 0x1230000 2>&1 | FileCheck -check-prefix IMAGE-BASE %s
193 RUN: ld.lld -### -m i386pep foo.o -image-base 0x1230000 2>&1 | FileCheck -check-prefix IMAGE-BASE %s
194 RUN: ld.lld -### -m i386pep foo.o --image-base=0x1230000 2>&1 | FileCheck -check-prefix IMAGE-BASE %s
195 IMAGE-BASE: -base:0x1230000
197 RUN: ld.lld -### -m i386pep foo.o 2>&1 | FileCheck -check-prefix NO-GC-SECTIONS %s
198 RUN: ld.lld -### -m i386pep foo.o --gc-sections --no-gc-sections 2>&1 | FileCheck -check-prefix NO-GC-SECTIONS %s
199 NO-GC-SECTIONS: -opt:noref
201 RUN: ld.lld -### -m i386pep foo.o --gc-sections 2>&1 | FileCheck -check-prefix GC-SECTIONS %s
202 RUN: ld.lld -### -m i386pep foo.o -gc-sections 2>&1 | FileCheck -check-prefix GC-SECTIONS %s
203 GC-SECTIONS: -opt:ref
205 RUN: ld.lld -### -m i386pep foo.o 2>&1 | FileCheck -check-prefix ICF-NONE %s
206 RUN: ld.lld -### -m i386pep foo.o --icf=none 2>&1 | FileCheck -check-prefix ICF-NONE %s
207 RUN: ld.lld -### -m i386pep foo.o -icf=none 2>&1 | FileCheck -check-prefix ICF-NONE %s
210 RUN: ld.lld -### -m i386pep foo.o --icf=safe 2>&1 | FileCheck -check-prefix ICF-SAFE %s
211 RUN: ld.lld -### -m i386pep foo.o -icf=safe 2>&1 | FileCheck -check-prefix ICF-SAFE %s
212 ICF-SAFE: -opt:safeicf
214 RUN: ld.lld -### -m i386pep foo.o --icf=all 2>&1 | FileCheck -check-prefix ICF %s
215 RUN: ld.lld -### -m i386pep foo.o -icf=all 2>&1 | FileCheck -check-prefix ICF %s
216 RUN: ld.lld -### -m i386pep foo.o --icf all 2>&1 | FileCheck -check-prefix ICF %s
219 RUN: ld.lld -### -m i386pep --start-group foo.o --end-group 2> /dev/null
221 RUN: ld.lld -### foo.o -m i386pe -shared --kill-at 2>&1 | FileCheck -check-prefix=KILL-AT %s
222 RUN: ld.lld -### foo.o -m i386pe -shared -kill-at 2>&1 | FileCheck -check-prefix=KILL-AT %s
225 RUN: ld.lld -### foo.o -m i386pep -Map bar.map 2>&1 | FileCheck -check-prefix=MAP %s
226 RUN: ld.lld -### foo.o -m i386pep --Map bar.map 2>&1 | FileCheck -check-prefix=MAP %s
227 RUN: ld.lld -### foo.o -m i386pep -Map=bar.map 2>&1 | FileCheck -check-prefix=MAP %s
228 RUN: ld.lld -### foo.o -m i386pep --Map=bar.map 2>&1 | FileCheck -check-prefix=MAP %s
231 RUN: ld.lld -### foo.o -m i386pe -require-defined _foo --require-defined _bar -require-defined=_baz --require-defined=_foo2 2>&1 | FileCheck -check-prefix=REQUIRE-DEFINED %s
232 REQUIRE-DEFINED: -include:_foo -include:_bar -include:_baz -include:_foo2
234 RUN: ld.lld -### foo.o -m i386pe -u _foo --undefined _bar -undefined=_baz --undefined=_foo2 -u_foo3 2>&1 | FileCheck -check-prefix=UNDEFINED %s
235 UNDEFINED: -includeoptional:_foo -includeoptional:_bar -includeoptional:_baz -includeoptional:_foo2 -includeoptional:_foo3
237 RUN: ld.lld -### -m i386pep foo.o -Llibpath 2>&1 | FileCheck -check-prefix LIBPATH %s
238 LIBPATH: -libpath:libpath
240 RUN: ld.lld -### -m i386pep foo.o --reproduce=foo.tar 2>&1 | FileCheck -check-prefix REPRO %s
241 REPRO: -reproduce:foo.tar
243 RUN: ld.lld -### -m i386pep foo.o --no-insert-timestamp 2>&1 | FileCheck -check-prefix NOTIMESTAMP %s
244 RUN: ld.lld -### -m i386pep foo.o --insert-timestamp --no-insert-timestamp 2>&1 | FileCheck -check-prefix NOTIMESTAMP %s
245 NOTIMESTAMP: -timestamp:0
246 RUN: ld.lld -### -m i386pep foo.o --no-insert-timestamp --insert-timestamp 2>&1 | FileCheck -check-prefix TIMESTAMP %s
247 TIMESTAMP-NOT: -timestamp:0
249 RUN: ld.lld -### -m i386pep foo.o -appcontainer 2>&1 | FileCheck -check-prefix APPCONTAINER %s
250 RUN: ld.lld -### -m i386pep foo.o --appcontainer 2>&1 | FileCheck -check-prefix APPCONTAINER %s
251 APPCONTAINER: -appcontainer
253 RUN: ld.lld -m i386pep --version 2>&1 | FileCheck -check-prefix=VERSION %s
254 RUN: ld.lld -m i386pep -v 2>&1 | FileCheck -check-prefix=VERSION %s
255 RUN: not ld.lld -m i386pep -v xyz 2>&1 | FileCheck -check-prefix=VERSION %s
256 VERSION: LLD {{.*}} (compatible with GNU linkers)
258 RUN: ld.lld -m i386pep --help 2>&1 | FileCheck -check-prefix=HELP %s
260 HELP: --enable-auto-import
262 RUN: ld.lld -### -m i386pep foo.o -delayload user32.dll --delayload shell32.dll 2>&1 | FileCheck -check-prefix DELAYLOAD %s
263 RUN: ld.lld -### -m i386pep foo.o -delayload=user32.dll --delayload=shell32.dll 2>&1 | FileCheck -check-prefix DELAYLOAD %s
264 DELAYLOAD: -delayload:user32.dll -delayload:shell32.dll
266 RUN: not ld.lld -m i386pep -entry 2>&1 | FileCheck -check-prefix MISSING_ARG %s
267 MISSING_ARG: error: -entry: missing argument
269 RUN: not ld.lld -m i386pep --foo 2>&1 | FileCheck -check-prefix UNKNOWN_ARG %s
270 UNKNOWN_ARG: error: unknown argument: --foo
272 RUN: not ld.lld -m i386pep 2>&1 | FileCheck -check-prefix NO_INPUT_FILES %s
273 NO_INPUT_FILES: error: no input files
275 RUN: ld.lld -### -m i386pep foo.o 2>&1 | FileCheck -check-prefix ENABLE_AUTO_IMPORT %s
276 RUN: ld.lld -### -m i386pep foo.o --disable-auto-import --enable-auto-import 2>&1 | FileCheck -check-prefix ENABLE_AUTO_IMPORT %s
277 RUN: ld.lld -### -m i386pep foo.o -enable-auto-import 2>&1 | FileCheck -check-prefix ENABLE_AUTO_IMPORT %s
278 ENABLE_AUTO_IMPORT: -auto-import{{ }}
280 RUN: ld.lld -### -m i386pep foo.o --disable-auto-import 2>&1 | FileCheck -check-prefix DISABLE_AUTO_IMPORT %s
281 RUN: ld.lld -### -m i386pep foo.o -disable-auto-import 2>&1 | FileCheck -check-prefix DISABLE_AUTO_IMPORT %s
282 DISABLE_AUTO_IMPORT: -auto-import:no
284 RUN: ld.lld -### -m i386pep foo.o 2>&1 | FileCheck -check-prefix ENABLE_RUNTIME_PSEUDO_RELOC %s
285 RUN: ld.lld -### -m i386pep foo.o --disable-runtime-pseudo-reloc --enable-runtime-pseudo-reloc 2>&1 | FileCheck -check-prefix ENABLE_RUNTIME_PSEUDO_RELOC %s
286 RUN: ld.lld -### -m i386pep foo.o -enable-runtime-pseudo-reloc 2>&1 | FileCheck -check-prefix ENABLE_RUNTIME_PSEUDO_RELOC %s
287 ENABLE_RUNTIME_PSEUDO_RELOC: -runtime-pseudo-reloc{{ }}
289 RUN: ld.lld -### -m i386pep foo.o --disable-runtime-pseudo-reloc 2>&1 | FileCheck -check-prefix DISABLE_RUNTIME_PSEUDO_RELOC %s
290 RUN: ld.lld -### -m i386pep foo.o -disable-runtime-pseudo-reloc 2>&1 | FileCheck -check-prefix DISABLE_RUNTIME_PSEUDO_RELOC %s
291 DISABLE_RUNTIME_PSEUDO_RELOC: -runtime-pseudo-reloc:no
293 RUN: ld.lld -### foo.o -m i386pe --thinlto-cache-dir=_foo 2>&1 | FileCheck -check-prefix=THINLTO_CACHEDIR %s
294 THINLTO_CACHEDIR: -lldltocache:_foo
296 RUN: ld.lld -### -m i386pep foo.o --file-alignment 0x1000 2>&1 | FileCheck -check-prefix FILEALIGN %s
297 RUN: ld.lld -### -m i386pep foo.o -file-alignment 0x1000 2>&1 | FileCheck -check-prefix FILEALIGN %s
298 RUN: ld.lld -### -m i386pep foo.o --file-alignment=0x1000 2>&1 | FileCheck -check-prefix FILEALIGN %s
299 RUN: ld.lld -### -m i386pep foo.o -file-alignment=0x1000 2>&1 | FileCheck -check-prefix FILEALIGN %s
300 FILEALIGN: -filealign:0x1000
302 RUN: ld.lld -### -m i386pep foo.o --section-alignment 0x2000 2>&1 | FileCheck -check-prefix ALIGN %s
303 RUN: ld.lld -### -m i386pep foo.o -section-alignment 0x2000 2>&1 | FileCheck -check-prefix ALIGN %s
304 RUN: ld.lld -### -m i386pep foo.o --section-alignment=0x2000 2>&1 | FileCheck -check-prefix ALIGN %s
305 RUN: ld.lld -### -m i386pep foo.o -section-alignment=0x2000 2>&1 | FileCheck -check-prefix ALIGN %s
308 RUN: ld.lld -### -m i386pe foo.o -disable-no-seh -no-seh 2>&1 | FileCheck -check-prefix NOSEH %s
309 RUN: ld.lld -### -m i386pe foo.o --disable-no-seh --no-seh 2>&1 | FileCheck -check-prefix NOSEH %s
310 RUN: ld.lld -### -m i386pe foo.o -no-seh -disable-no-seh 2>&1 | FileCheck -check-prefix DISABLE-NOSEH %s
311 RUN: ld.lld -### -m i386pe foo.o --no-seh --disable-no-seh 2>&1 | FileCheck -check-prefix DISABLE-NOSEH %s
313 DISABLE-NOSEH-NOT: -noseh
315 RUN: ld.lld -### -m i386pep foo.o --no-allow-multiple-definition --allow-multiple-definition 2>&1 | FileCheck -check-prefix ALLOW_MULTIPLE_DEFINITION %s
316 RUN: ld.lld -### -m i386pep foo.o -no-allow-multiple-definition -allow-multiple-definition 2>&1 | FileCheck -check-prefix ALLOW_MULTIPLE_DEFINITION %s
317 ALLOW_MULTIPLE_DEFINITION: -force:multiple
319 RUN: ld.lld -### -m i386pep foo.o --allow-multiple-definition --no-allow-multiple-definition 2>&1 | FileCheck -check-prefix NO_ALLOW_MULTIPLE_DEFINITION %s
320 RUN: ld.lld -### -m i386pep foo.o -allow-multiple-definition -no-allow-multiple-definition 2>&1 | FileCheck -check-prefix NO_ALLOW_MULTIPLE_DEFINITION %s
321 NO_ALLOW_MULTIPLE_DEFINITION-NOT: -force:multiple
323 RUN: ld.lld -### -m i386pep foo.o -wrap foo1 --wrap foo2 2>&1 | FileCheck -check-prefix WRAP %s
324 RUN: ld.lld -### -m i386pep foo.o -wrap=foo1 --wrap=foo2 2>&1 | FileCheck -check-prefix WRAP %s
325 WRAP: -wrap:foo1 -wrap:foo2
327 RUN: ld.lld -### -m i386pep foo.o -exclude-symbols sym1,sym2 --exclude-symbols sym3 2>&1 | FileCheck -check-prefix EXCLUDE_SYMBOLS %s
328 RUN: ld.lld -### -m i386pep foo.o -exclude-symbols=sym1,sym2 --exclude-symbols=sym3 2>&1 | FileCheck -check-prefix EXCLUDE_SYMBOLS %s
329 EXCLUDE_SYMBOLS: -exclude-symbols:sym1,sym2 -exclude-symbols:sym3
331 RUN: ld.lld -### -m i386pep foo.o 2>&1 | FileCheck -check-prefix DEMANGLE %s
332 RUN: ld.lld -### -m i386pep foo.o -demangle 2>&1 | FileCheck -check-prefix DEMANGLE %s
333 RUN: ld.lld -### -m i386pep foo.o --demangle 2>&1 | FileCheck -check-prefix DEMANGLE %s
334 DEMANGLE: -demangle{{ }}
336 RUN: ld.lld -### -m i386pep foo.o -no-demangle 2>&1 | FileCheck -check-prefix NO-DEMANGLE %s
337 RUN: ld.lld -### -m i386pep foo.o --no-demangle 2>&1 | FileCheck -check-prefix NO-DEMANGLE %s
338 NO-DEMANGLE: -demangle:no
340 RUN: ld.lld -### -m i386pep foo.o -fatal-warnings 2>&1 | FileCheck -check-prefix FATAL_WARNINGS %s
341 RUN: ld.lld -### -m i386pep foo.o --fatal-warnings 2>&1 | FileCheck -check-prefix FATAL_WARNINGS %s
342 FATAL_WARNINGS: -WX{{ }}
344 RUN: ld.lld -### -m i386pep foo.o 2>&1 | FileCheck -check-prefix NO-FATAL_WARNINGS %s
345 RUN: ld.lld -### -m i386pep foo.o -no-fatal-warnings 2>&1 | FileCheck -check-prefix NO-FATAL_WARNINGS %s
346 RUN: ld.lld -### -m i386pep foo.o --no-fatal-warnings 2>&1 | FileCheck -check-prefix NO-FATAL_WARNINGS %s
347 NO-FATAL_WARNINGS: -WX:no
349 RUN: ld.lld -### -m i386pep foo.o 2>&1 | FileCheck -check-prefix NO-FIXUP %s
350 NO-FIXUP-NOT: -stdcall-fixup
352 RUN: ld.lld -### -m i386pep foo.o --enable-stdcall-fixup --disable-stdcall-fixup 2>&1 | FileCheck -check-prefix DISABLE-FIXUP %s
353 DISABLE-FIXUP: -stdcall-fixup:no
355 RUN: ld.lld -### -m i386pep foo.o --disable-stdcall-fixup --enable-stdcall-fixup 2>&1 | FileCheck -check-prefix ENABLE-FIXUP %s
356 ENABLE-FIXUP: -stdcall-fixup{{ }}
358 RUN: ld.lld -### foo.o -m i386pep -heap 8388608,16384 2>&1 | FileCheck -check-prefix=HEAP %s
359 RUN: ld.lld -### foo.o -m i386pep --heap 8388608,16384 2>&1 | FileCheck -check-prefix=HEAP %s
360 RUN: ld.lld -### foo.o -m i386pep --heap=8388608,16384 2>&1 | FileCheck -check-prefix=HEAP %s
361 HEAP: -heap:8388608,16384
363 RUN: ld.lld -### foo.o -m i386pep --no-guard-cf 2>&1 | FileCheck -check-prefix=NO_GUARD_CF %s
364 RUN: ld.lld -### foo.o -m i386pep --no-guard-cf --no-guard-longjmp 2>&1 | FileCheck -check-prefix=NO_GUARD_CF %s
365 NO_GUARD_CF-NOT: -guard:
367 RUN: ld.lld -### foo.o -m i386pep --guard-cf 2>&1 | FileCheck -check-prefix=GUARD_CF %s
368 RUN: ld.lld -### foo.o -m i386pep --guard-cf --guard-longjmp 2>&1 | FileCheck -check-prefix=GUARD_CF %s
369 GUARD_CF: -guard:cf,longjmp
371 RUN: ld.lld -### foo.o -m i386pep --guard-cf --no-guard-longjmp 2>&1 | FileCheck -check-prefix=GUARD_CF_NOLONGJMP %s
372 GUARD_CF_NOLONGJMP: -guard:cf,nolongjmp
374 RUN: ld.lld -### foo.o -m i386pep --guard-longjmp 2>&1 | FileCheck -check-prefix=GUARD_LONGJMP_NO_CF %s
375 RUN: ld.lld -### foo.o -m i386pep --no-guard-cf --guard-longjmp 2>&1 | FileCheck -check-prefix=GUARD_LONGJMP_NO_CF %s
376 GUARD_LONGJMP_NO_CF: warning: parameter --guard-longjmp only takes effect when used with --guard-cf
378 RUN: ld.lld -### foo.o -m i386pep --threads 3 --thinlto-jobs=4 2>&1 | FileCheck -check-prefix=THREADS %s
379 RUN: ld.lld -### foo.o -m i386pep --threads 3 -plugin-opt=jobs=4 2>&1 | FileCheck -check-prefix=THREADS %s
380 THREADS: -threads:3 {{.*}} -opt:lldltojobs=4
382 RUN: ld.lld -### foo.o -m i386pep -plugin-opt=mcpu=x86-64 -plugin-opt=-emulated-tls -plugin-opt=thinlto -plugin-opt=O2 -plugin-opt=dwo_dir=foo -plugin-opt=cs-profile-generate -plugin-opt=cs-profile-path=bar 2>&1 | FileCheck -check-prefix=LTO_OPTS %s
383 LTO_OPTS: -mllvm:-mcpu=x86-64 -opt:lldlto=2 -dwodir:foo -lto-cs-profile-generate -lto-cs-profile-file:bar -mllvm:-emulated-tls
385 RUN: ld.lld -### foo.o -m i386pep --lto-O2 --lto-CGO1 --lto-cs-profile-generate --lto-cs-profile-file=foo 2>&1 | FileCheck -check-prefix=LTO_OPTS2 %s
386 LTO_OPTS2:-opt:lldlto=2 -opt:lldltocgo=1 -lto-cs-profile-generate -lto-cs-profile-file:foo
388 Test GCC specific LTO options that GCC passes unconditionally, that we ignore.
390 RUN: ld.lld -### foo.o -m i386pep -plugin /usr/lib/gcc/x86_64-w64-mingw32/10-posix/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-w64-mingw32/10-posix/lto-wrapper -plugin-opt=-fresolution=/tmp/ccM9d4fP.res -plugin-opt=-pass-through=-lmingw32 2> /dev/null
391 RUN: ld.lld -### foo.o -m i386pep -plugin C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/liblto_plugin.dll -plugin-opt=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/lto-wrapper.exe -plugin-opt=-fresolution=C:/msys64/tmp/cckbC7wB.res -plugin-opt=-pass-through=-lmingw32 2> /dev/null