1 // RUN: %clang --target=x86_64-unknown-netbsd \
2 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
3 // RUN: | FileCheck -check-prefix=STATIC %s
4 // RUN: %clang --target=x86_64-unknown-netbsd \
5 // RUN: -pie --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
6 // RUN: | FileCheck -check-prefix=PIE %s
7 // RUN: %clang --target=x86_64-unknown-netbsd \
8 // RUN: -static -pie --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
9 // RUN: | FileCheck -check-prefix=STATIC-PIE %s
10 // RUN: %clang --target=x86_64-unknown-netbsd \
11 // RUN: -shared --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
12 // RUN: | FileCheck -check-prefix=SHARED %s
14 // RUN: %clang --target=x86_64-unknown-netbsd \
15 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
16 // RUN: | FileCheck -check-prefix=X86_64 %s
17 // RUN: %clang --target=x86_64-unknown-netbsd7.0.0 \
18 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
19 // RUN: | FileCheck -check-prefix=X86_64-7 %s
20 // RUN: %clang --target=aarch64-unknown-netbsd \
21 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
22 // RUN: | FileCheck -check-prefix=AARCH64 %s
23 // RUN: %clang --target=aarch64-unknown-netbsd7.0.0 \
24 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
25 // RUN: | FileCheck -check-prefix=AARCH64-7 %s
26 // RUN: %clang --target=aarch64_be-unknown-netbsd \
27 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
28 // RUN: | FileCheck -check-prefix=AARCH64_BE %s
29 // RUN: %clang --target=aarch64_be-unknown-netbsd7.0.0 \
30 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
31 // RUN: | FileCheck -check-prefix=AARCH64_BE-7 %s
32 // RUN: %clang --target=arm-unknown-netbsd-eabi \
33 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
34 // RUN: | FileCheck -check-prefix=ARM %s
35 // RUN: %clang --target=armeb-unknown-netbsd-eabi \
36 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
37 // RUN: | FileCheck -check-prefix=ARMEB %s
38 // RUN: %clang --target=armeb-unknown-netbsd-eabi -march=armv7 \
39 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
40 // RUN: | FileCheck -check-prefix=ARMV7EB %s
41 // RUN: %clang --target=armv7eb-unknown-netbsd-eabi \
42 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
43 // RUN: | FileCheck -check-prefix=ARMV7EB %s
44 // RUN: %clang -r --target=armeb-unknown-netbsd-eabi \
45 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
46 // RUN: | FileCheck -check-prefix=ARMEB-R %s
47 // RUN: %clang --target=arm-unknown-netbsd \
48 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
49 // RUN: | FileCheck -check-prefix=ARM-APCS %s
50 // RUN: %clang --target=arm-unknown-netbsd-eabihf \
51 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
52 // RUN: | FileCheck -check-prefix=ARM-HF %s
53 // RUN: %clang --target=thumb-unknown-netbsd-eabi \
54 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
55 // RUN: | FileCheck -check-prefix=THUMB %s
56 // RUN: %clang --target=thumbeb-unknown-netbsd-eabi \
57 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
58 // RUN: | FileCheck -check-prefix=THUMBEB %s
59 // RUN: %clang --target=arm-unknown-netbsd7.0.0-eabi \
60 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
61 // RUN: | FileCheck -check-prefix=ARM-7 %s
62 // RUN: %clang --target=riscv32-unknown-netbsd \
63 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
64 // RUN: | FileCheck -check-prefix=RISCV32 %s
65 // RUN: %clang --target=riscv64-unknown-netbsd \
66 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
67 // RUN: | FileCheck -check-prefix=RISCV64 %s
68 // RUN: %clang --target=sparc-unknown-netbsd \
69 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
70 // RUN: | FileCheck -check-prefix=SPARC %s
71 // RUN: %clang --target=sparc64-unknown-netbsd \
72 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
73 // RUN: | FileCheck -check-prefix=SPARC64 %s
74 // RUN: %clang --target=powerpc-unknown-netbsd \
75 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
76 // RUN: | FileCheck -check-prefix=POWERPC %s
77 // RUN: %clang --target=powerpc64-unknown-netbsd \
78 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
79 // RUN: | FileCheck -check-prefix=POWERPC64 %s
81 // RUN: %clang --target=x86_64-unknown-netbsd -static \
82 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
83 // RUN: | FileCheck -check-prefix=S-X86_64 %s
84 // RUN: %clang --target=x86_64-unknown-netbsd7.0.0 -static \
85 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
86 // RUN: | FileCheck -check-prefix=S-X86_64-7 %s
87 // RUN: %clang --target=aarch64-unknown-netbsd -static \
88 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
89 // RUN: | FileCheck -check-prefix=S-AARCH64 %s
90 // RUN: %clang --target=aarch64-unknown-netbsd7.0.0 -static \
91 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
92 // RUN: | FileCheck -check-prefix=S-AARCH64-7 %s
93 // RUN: %clang --target=aarch64_be-unknown-netbsd -static \
94 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
95 // RUN: | FileCheck -check-prefix=S-AARCH64_BE %s
96 // RUN: %clang --target=aarch64_be-unknown-netbsd7.0.0 -static \
97 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
98 // RUN: | FileCheck -check-prefix=S-AARCH64_BE-7 %s
99 // RUN: %clang --target=arm-unknown-netbsd-eabi -static \
100 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
101 // RUN: | FileCheck -check-prefix=S-ARM %s
102 // RUN: %clang --target=armeb-unknown-netbsd-eabi -static \
103 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
104 // RUN: | FileCheck -check-prefix=S-ARMEB %s
105 // RUN: %clang --target=arm-unknown-netbsd7.0.0-eabi -static \
106 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
107 // RUN: | FileCheck -check-prefix=S-ARM-7 %s
108 // RUN: %clang --target=riscv32-unknown-netbsd7.0.0 -static \
109 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
110 // RUN: | FileCheck -check-prefix=S-RISCV32-7 %s
111 // RUN: %clang --target=riscv64-unknown-netbsd7.0.0 -static \
112 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
113 // RUN: | FileCheck -check-prefix=S-RISCV64-7 %s
114 // RUN: %clang --target=sparc-unknown-netbsd7.0.0 -static \
115 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
116 // RUN: | FileCheck -check-prefix=S-SPARC-7 %s
117 // RUN: %clang --target=sparc64-unknown-netbsd7.0.0 -static \
118 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
119 // RUN: | FileCheck -check-prefix=S-SPARC64-7 %s
120 // RUN: %clang --target=powerpc-unknown-netbsd -static \
121 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
122 // RUN: | FileCheck -check-prefix=S-POWERPC %s
123 // RUN: %clang --target=powerpc64-unknown-netbsd -static \
124 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
125 // RUN: | FileCheck -check-prefix=S-POWERPC64 %s
126 // RUN: %clang --target=x86_64-unknown-netbsd -pthread -dM -E %s \
127 // RUN: | FileCheck -check-prefix=PTHREAD %s
129 // STATIC: ld{{.*}}" "--eh-frame-hdr"
130 // STATIC-NOT: "-pie"
131 // STATIC-NOT: "-shared"
132 // STATIC: "-dynamic-linker" "/libexec/ld.elf_so"
133 // STATIC-NOT: "-pie"
134 // STATIC-NOT: "-shared"
135 // STATIC: "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
136 // STATIC: "{{.*}}/usr/lib{{/|\\\\}}crti.o" "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o"
137 // STATIC: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
139 // STATIC-PIE: ld{{.*}}" "--eh-frame-hdr"
140 // STATIC-PIE-NOT: "-dynamic-linker" "/libexec/ld.elf_so"
141 // STATIC-PIE-NOT: "-shared"
142 // STATIC-PIE: "-pie"
143 // STATIC-PIE-NOT: "-dynamic-linker" "/libexec/ld.elf_so"
144 // STATIC-PIE-NOT: "-shared"
145 // STATIC-PIE: "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
146 // STATIC-PIE: "{{.*}}/usr/lib{{/|\\\\}}crti.o" "{{.*}}/usr/lib{{/|\\\\}}crtbeginS.o"
147 // STATIC-PIE: "{{.*}}/usr/lib{{/|\\\\}}crtendS.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
149 // SHARED: ld{{.*}}" "--eh-frame-hdr"
150 // SHARED-NOT: "-pie"
151 // SHARED-NOT: "-dynamic-linker"
152 // SHARED-NOT: "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
153 // SHARED: "{{.*}}/usr/lib{{/|\\\\}}crti.o" "{{.*}}/usr/lib{{/|\\\\}}crtbeginS.o"
154 // SHARED: "{{.*}}/usr/lib{{/|\\\\}}crtendS.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
156 // PIE: ld{{.*}}" "--eh-frame-hdr"
157 // PIE-NOT: "-shared"
158 // PIE: "-pie" "-dynamic-linker" "/libexec/ld.elf_so"
159 // PIE-NOT: "-shared"
160 // PIE: "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
161 // PIE: "{{.*}}/usr/lib{{/|\\\\}}crtbeginS.o"
162 // PIE: "{{.*}}/usr/lib{{/|\\\\}}crtendS.o"
163 // PIE: "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
165 // X86_64: "-cc1" "-triple" "x86_64-unknown-netbsd"
166 // X86_64-NOT: "-fno-use-init-array"
167 // X86_64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
168 // X86_64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
169 // X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
170 // X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
172 // X86_64-7: "-cc1" "-triple" "x86_64-unknown-netbsd7.0.0"
173 // X86_64-7: "-fno-use-init-array"
174 // X86_64-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
175 // X86_64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
176 // X86_64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
177 // X86_64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
179 // AARCH64: "-cc1" "-triple" "aarch64-unknown-netbsd"
180 // AARCH64-NOT: "-fno-use-init-array"
181 // AARCH64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
182 // AARCH64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
183 // AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
184 // AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
186 // AARCH64-7: "-cc1" "-triple" "aarch64-unknown-netbsd7.0.0"
187 // AARCH64-7-NOT: "-fno-use-init-array"
188 // AARCH64-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
189 // AARCH64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
190 // AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
191 // AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
193 // AARCH64_BE: "-cc1" "-triple" "aarch64_be-unknown-netbsd"
194 // AARCH64_BE-NOT: "-fno-use-init-array"
195 // AARCH64_BE: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
196 // AARCH64_BE: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
197 // AARCH64_BE: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
198 // AARCH64_BE: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
200 // AARCH64_BE-7: "-cc1" "-triple" "aarch64_be-unknown-netbsd7.0.0"
201 // AARCH64_BE-7-NOT: "-fno-use-init-array"
202 // AARCH64_BE-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
203 // AARCH64_BE-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
204 // AARCH64_BE-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
205 // AARCH64_BE-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
207 // ARM: "-cc1" "-triple" "armv5e-unknown-netbsd-eabi"
208 // ARM-NOT: "-fno-use-init-array"
209 // ARM: as{{.*}}" "-mcpu=arm926ej-s" "-o"
210 // ARM: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
211 // ARM: "-m" "armelf_nbsd_eabi"
212 // ARM: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
213 // ARM: "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o"
214 // ARM: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
215 // ARM: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
217 // ARMEB: "-cc1" "-triple" "armebv5e-unknown-netbsd-eabi"
218 // ARMEB-NOT: "-fno-use-init-array"
219 // ARMEB: as{{.*}}" "-mcpu=arm926ej-s" "-o"
220 // ARMEB: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
221 // ARMEB-NOT: "--be8"
222 // ARMEB: "-m" "armelfb_nbsd_eabi"
223 // ARMEB: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
224 // ARMEB: "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o"
225 // ARMEB: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
226 // ARMEB: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
227 // ARMV7EB: as{{.*}}" "-mcpu=cortex-a8"
228 // ARMV7EB: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
229 // ARMV7EB: "--be8" "-m" "armelfb_nbsd_eabi"
231 // ARMEB-R: ld{{.*}}"
232 // ARMEB-R-NOT: "--be8"
234 // ARM-APCS: "-cc1" "-triple" "armv4-unknown-netbsd"
235 // ARM-APCS: as{{.*}}" "-mcpu=strongarm" "-o"
236 // ARM-APCS: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
237 // ARM-APCS: "-m" "armelf_nbsd"
238 // ARM-APCS: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
239 // ARM-APCS: "{{.*}}/usr/lib{{/|\\\\}}oabi{{/|\\\\}}crti.o"
240 // ARM-APCS: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
241 // ARM-APCS: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
243 // ARM-HF: "-cc1" "-triple" "armv5e-unknown-netbsd-eabihf"
244 // ARM-HF: as{{.*}}" "-mcpu=arm926ej-s" "-o"
245 // ARM-HF: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
246 // ARM-HF: "-m" "armelf_nbsd_eabihf"
247 // ARM-HF: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
248 // ARM-HF: "{{.*}}/usr/lib{{/|\\\\}}eabihf{{/|\\\\}}crti.o"
249 // ARM-HF: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
250 // ARM-HF: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
252 // THUMB: "-cc1" "-triple" "armv5e-unknown-netbsd-eabi"
253 // THUMB: as{{.*}}" "-mcpu=arm926ej-s" "-o"
254 // THUMB: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
255 // THUMB: "-m" "armelf_nbsd_eabi"
256 // THUMB: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
257 // THUMB: "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o"
258 // THUMB: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
259 // THUMB: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
261 // THUMBEB: "-cc1" "-triple" "armebv5e-unknown-netbsd-eabi"
262 // THUMBEB: as{{.*}}" "-mcpu=arm926ej-s" "-o"
263 // THUMBEB: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
264 // THUMBEB: "-m" "armelfb_nbsd_eabi"
265 // THUMBEB: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
266 // THUMBEB: "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o"
267 // THUMBEB: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
268 // THUMBEB: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
270 // ARM-7: "-cc1" "-triple" "armv5e-unknown-netbsd7.0.0-eabi"
271 // ARM-7-NOT: "-fno-use-init-array"
272 // ARM-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
273 // ARM-7: "-m" "armelf_nbsd_eabi"
274 // ARM-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
275 // ARM-7: "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o"
276 // ARM-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
277 // ARM-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
279 // RISCV32: "-cc1" "-triple" "riscv32-unknown-netbsd"
280 // RISCV32-NOT: "-fno-use-init-array"
281 // RISCV32: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
282 // RISCV32-SAME: "-m" "elf32lriscv" "-X"
283 // RISCV32-SAME: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
284 // RISCV32-SAME: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
285 // RISCV32-SAME: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
287 // RISCV64: "-cc1" "-triple" "riscv64-unknown-netbsd"
288 // RISCV64-NOT: "-fno-use-init-array"
289 // RISCV64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
290 // RISCV64-SAME: "-m" "elf64lriscv" "-X"
291 // RISCV64-SAME: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
292 // RISCV64-SAME: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
293 // RISCV64-SAME: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
295 // SPARC: "-cc1" "-triple" "sparc-unknown-netbsd"
296 // SPARC-NOT: "-fno-use-init-array"
297 // SPARC: as{{.*}}" "-32" "-Av8" "-o"
298 // SPARC: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
299 // SPARC: "-m" "elf32_sparc"
300 // SPARC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
301 // SPARC: "{{.*}}/usr/lib{{/|\\\\}}sparc{{/|\\\\}}crti.o"
302 // SPARC: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
303 // SPARC: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
305 // SPARC64: "-cc1" "-triple" "sparc64-unknown-netbsd"
306 // SPARC64-NOT: "-fno-use-init-array"
307 // SPARC64: as{{.*}}" "-64" "-Av9" "-o"
308 // SPARC64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
309 // SPARC64: "-m" "elf64_sparc"
310 // SPARC64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
311 // SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
312 // SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
314 // POWERPC: "-cc1" "-triple" "powerpc-unknown-netbsd"
315 // POWERPC-NOT: "-fno-use-init-array"
316 // POWERPC: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
317 // POWERPC: "-m" "elf32ppc_nbsd"
318 // POWERPC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
319 // POWERPC: "{{.*}}/usr/lib{{/|\\\\}}powerpc{{/|\\\\}}crti.o"
320 // POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
321 // POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
323 // POWERPC64: "-cc1" "-triple" "powerpc64-unknown-netbsd"
324 // POWERPC64-NOT: "-fno-use-init-array"
325 // POWERPC64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
326 // POWERPC64: "-m" "elf64ppc"
327 // POWERPC64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
328 // POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crti.o"
329 // POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
330 // POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
332 // S-X86_64: "-cc1" "-triple" "x86_64-unknown-netbsd"
333 // S-X86_64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
334 // S-X86_64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
335 // S-X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
336 // S-X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
338 // S-X86_64-7: "-cc1" "-triple" "x86_64-unknown-netbsd7.0.0"
339 // S-X86_64-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
340 // S-X86_64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
341 // S-X86_64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
342 // S-X86_64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
344 // S-AARCH64: "-cc1" "-triple" "aarch64-unknown-netbsd"
345 // S-AARCH64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
346 // S-AARCH64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
347 // S-AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
348 // S-AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
350 // S-AARCH64-7: "-cc1" "-triple" "aarch64-unknown-netbsd7.0.0"
351 // S-AARCH64-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
352 // S-AARCH64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
353 // S-AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
354 // S-AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
356 // S-AARCH64_BE: "-cc1" "-triple" "aarch64_be-unknown-netbsd"
357 // S-AARCH64_BE: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
358 // S-AARCH64_BE: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
359 // S-AARCH64_BE: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
360 // S-AARCH64_BE: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
362 // S-AARCH64_BE-7: "-cc1" "-triple" "aarch64_be-unknown-netbsd7.0.0"
363 // S-AARCH64_BE-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
364 // S-AARCH64_BE-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
365 // S-AARCH64_BE-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
366 // S-AARCH64_BE-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
368 // S-ARM: "-cc1" "-triple" "armv5e-unknown-netbsd-eabi"
369 // S-ARM: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
370 // S-ARM: "-m" "armelf_nbsd_eabi"
371 // S-ARM: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
372 // S-ARM: "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o"
373 // S-ARM: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
374 // S-ARM: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
376 // S-ARMEB: "-cc1" "-triple" "armebv5e-unknown-netbsd-eabi"
377 // S-ARMEB: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
378 // S-ARMEB: "-m" "armelfb_nbsd_eabi"
379 // S-ARMEB: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
380 // S-ARMEB: "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o"
381 // S-ARMEB: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
382 // S-ARMEB: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
384 // S-ARM-7: "-cc1" "-triple" "armv5e-unknown-netbsd7.0.0-eabi"
385 // S-ARM-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
386 // S-ARM-7: "-m" "armelf_nbsd_eabi"
387 // S-ARM-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
388 // S-ARM-7: "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o"
389 // S-ARM-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
390 // S-ARM-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
392 // S-RISCV32-7: "-cc1" "-triple" "riscv32-unknown-netbsd7.0.0"
393 // S-RISCV32-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
394 // S-RISCV32-7-SAME: "-m" "elf32lriscv" "-X"
395 // S-RISCV32-7-SAME: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
396 // S-RISCV32-7-SAME: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
397 // S-RISCV32-7-SAME: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
399 // S-RISCV64-7: "-cc1" "-triple" "riscv64-unknown-netbsd7.0.0"
400 // S-RISCV64-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
401 // S-RISCV64-7-SAME: "-m" "elf64lriscv" "-X"
402 // S-RISCV64-7-SAME: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
403 // S-RISCV64-7-SAME: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
404 // S-RISCV64-7-SAME: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
406 // S-SPARC-7: "-cc1" "-triple" "sparc-unknown-netbsd7.0.0"
407 // S-SPARC-7: "-fno-use-init-array"
408 // S-SPARC-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
409 // S-SPARC-7: "-m" "elf32_sparc"
410 // S-SPARC-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
411 // S-SPARC-7: "{{.*}}/usr/lib{{/|\\\\}}sparc{{/|\\\\}}crti.o"
412 // S-SPARC-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
413 // S-SPARC-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
415 // S-SPARC64-7: "-cc1" "-triple" "sparc64-unknown-netbsd7.0.0"
416 // S-SPARC64-7: "-fno-use-init-array"
417 // S-SPARC64-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
418 // S-SPARC64-7: "-m" "elf64_sparc"
419 // S-SPARC64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
420 // S-SPARC64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
421 // S-SPARC64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
423 // S-POWERPC: "-cc1" "-triple" "powerpc-unknown-netbsd"
424 // S-POWERPC: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
425 // S-POWERPC: "-m" "elf32ppc_nbsd"
426 // S-POWERPC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
427 // S-POWERPC: "{{.*}}/usr/lib{{/|\\\\}}powerpc{{/|\\\\}}crti.o"
428 // S-POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
429 // S-POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
431 // S-POWERPC64: "-cc1" "-triple" "powerpc64-unknown-netbsd"
432 // S-POWERPC64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
433 // S-POWERPC64: "-m" "elf64ppc"
434 // S-POWERPC64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
435 // S-POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crti.o"
436 // S-POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
437 // S-POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
439 // PTHREAD-NOT: _POSIX_THREADS
440 // PTHREAD: _REENTRANT
441 // PTHREAD-NOT: _POSIX_THREADS
443 // Check PowerPC for Secure PLT
444 // RUN: %clang --target=powerpc-unknown-netbsd -### -c %s 2>&1 \
445 // RUN: | FileCheck -check-prefix=POWERPC-SECUREPLT %s
446 // POWERPC-SECUREPLT: "-target-feature" "+secure-plt"
448 // -r suppresses -dynamic-linker, default -l and crt*.o like -nostdlib.
449 // RUN: %clang --target=x86_64-unknown-netbsd -r \
450 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
451 // RUN: | FileCheck -check-prefix=RELOCATABLE %s
453 // RELOCATABLE-NOT: "-pie"
454 // RELOCATABLE-NOT: "-dynamic-linker"
455 // RELOCATABLE-NOT: "-l
456 // RELOCATABLE-NOT: crt{{[^./\\]+}}.o
458 // Check that the driver passes include paths to cc1 on NetBSD.
459 // RUN: %clang -### %s --target=x86_64-unknown-netbsd -r 2>&1 \
460 // RUN: | FileCheck %s --check-prefix=DRIVER-PASS-INCLUDES
461 // DRIVER-PASS-INCLUDES: "-cc1" {{.*}}"-resource-dir" "[[RESOURCE:[^"]+]]"
462 // DRIVER-PASS-INCLUDES-SAME: "-internal-isystem" "[[RESOURCE]]{{/|\\\\}}include"
463 // DRIVER-PASS-INCLUDES-SAME: {{^}} "-internal-externc-isystem" "{{.*}}/usr/include"