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=aarch64-unknown-netbsd \
18 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
19 // RUN: | FileCheck -check-prefix=AARCH64 %s
20 // RUN: %clang --target=aarch64_be-unknown-netbsd \
21 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
22 // RUN: | FileCheck -check-prefix=AARCH64_BE %s
23 // RUN: %clang --target=arm-unknown-netbsd-eabi \
24 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
25 // RUN: | FileCheck -check-prefix=ARM %s
26 // RUN: %clang --target=armeb-unknown-netbsd-eabi \
27 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
28 // RUN: | FileCheck -check-prefix=ARMEB %s
29 // RUN: %clang --target=armeb-unknown-netbsd-eabi -march=armv7 \
30 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
31 // RUN: | FileCheck -check-prefix=ARMV7EB %s
32 // RUN: %clang --target=armv7eb-unknown-netbsd-eabi \
33 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
34 // RUN: | FileCheck -check-prefix=ARMV7EB %s
35 // RUN: %clang -r --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-R %s
38 // RUN: %clang --target=arm-unknown-netbsd \
39 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
40 // RUN: | FileCheck -check-prefix=ARM-APCS %s
41 // RUN: %clang --target=arm-unknown-netbsd-eabihf \
42 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
43 // RUN: | FileCheck -check-prefix=ARM-HF %s
44 // RUN: %clang --target=thumb-unknown-netbsd-eabi \
45 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
46 // RUN: | FileCheck -check-prefix=THUMB %s
47 // RUN: %clang --target=thumbeb-unknown-netbsd-eabi \
48 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
49 // RUN: | FileCheck -check-prefix=THUMBEB %s
50 // RUN: %clang --target=riscv32-unknown-netbsd \
51 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
52 // RUN: | FileCheck -check-prefix=RISCV32 %s
53 // RUN: %clang --target=riscv64-unknown-netbsd \
54 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
55 // RUN: | FileCheck -check-prefix=RISCV64 %s
56 // RUN: %clang --target=sparc-unknown-netbsd \
57 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
58 // RUN: | FileCheck -check-prefix=SPARC %s
59 // RUN: %clang --target=sparc64-unknown-netbsd \
60 // RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
61 // RUN: | FileCheck -check-prefix=SPARC64 %s
62 // RUN: %clang --target=powerpc-unknown-netbsd \
63 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
64 // RUN: | FileCheck -check-prefix=POWERPC %s
65 // RUN: %clang --target=powerpc64-unknown-netbsd \
66 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
67 // RUN: | FileCheck -check-prefix=POWERPC64 %s
69 // RUN: %clang --target=x86_64-unknown-netbsd -static \
70 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
71 // RUN: | FileCheck -check-prefix=S-X86_64 %s
72 // RUN: %clang --target=aarch64-unknown-netbsd -static \
73 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
74 // RUN: | FileCheck -check-prefix=S-AARCH64 %s
75 // RUN: %clang --target=aarch64_be-unknown-netbsd -static \
76 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
77 // RUN: | FileCheck -check-prefix=S-AARCH64_BE %s
78 // RUN: %clang --target=arm-unknown-netbsd-eabi -static \
79 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
80 // RUN: | FileCheck -check-prefix=S-ARM %s
81 // RUN: %clang --target=armeb-unknown-netbsd-eabi -static \
82 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
83 // RUN: | FileCheck -check-prefix=S-ARMEB %s
84 // RUN: %clang --target=powerpc-unknown-netbsd -static \
85 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
86 // RUN: | FileCheck -check-prefix=S-POWERPC %s
87 // RUN: %clang --target=powerpc64-unknown-netbsd -static \
88 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
89 // RUN: | FileCheck -check-prefix=S-POWERPC64 %s
90 // RUN: %clang --target=x86_64-unknown-netbsd -pthread -dM -E %s \
91 // RUN: | FileCheck -check-prefix=PTHREAD %s
93 // STATIC: ld{{.*}}" "--eh-frame-hdr"
95 // STATIC-NOT: "-shared"
96 // STATIC: "-dynamic-linker" "/libexec/ld.elf_so"
98 // STATIC-NOT: "-shared"
99 // STATIC: "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
100 // STATIC: "{{.*}}/usr/lib{{/|\\\\}}crti.o" "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o"
101 // STATIC: "-L{{.*}}/usr/lib"
102 // STATIC: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
104 // STATIC-PIE: ld{{.*}}" "--eh-frame-hdr"
105 // STATIC-PIE-NOT: "-dynamic-linker" "/libexec/ld.elf_so"
106 // STATIC-PIE-NOT: "-shared"
107 // STATIC-PIE: "-pie"
108 // STATIC-PIE-NOT: "-dynamic-linker" "/libexec/ld.elf_so"
109 // STATIC-PIE-NOT: "-shared"
110 // STATIC-PIE: "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
111 // STATIC-PIE: "{{.*}}/usr/lib{{/|\\\\}}crti.o" "{{.*}}/usr/lib{{/|\\\\}}crtbeginS.o"
112 // STATIC-PIE: "-L{{.*}}/usr/lib"
113 // STATIC-PIE: "{{.*}}/usr/lib{{/|\\\\}}crtendS.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
115 // SHARED: ld{{.*}}" "--eh-frame-hdr"
116 // SHARED-NOT: "-pie"
117 // SHARED-NOT: "-dynamic-linker"
118 // SHARED-NOT: "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
119 // SHARED: "{{.*}}/usr/lib{{/|\\\\}}crti.o" "{{.*}}/usr/lib{{/|\\\\}}crtbeginS.o"
120 // SHARED: "-L{{.*}}/usr/lib"
121 // SHARED: "{{.*}}/usr/lib{{/|\\\\}}crtendS.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
123 // PIE: ld{{.*}}" "--eh-frame-hdr"
124 // PIE-NOT: "-shared"
125 // PIE: "-pie" "-dynamic-linker" "/libexec/ld.elf_so"
126 // PIE-NOT: "-shared"
127 // PIE: "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
128 // PIE: "{{.*}}/usr/lib{{/|\\\\}}crtbeginS.o"
129 // PIE: "-L{{.*}}/usr/lib"
130 // PIE: "{{.*}}/usr/lib{{/|\\\\}}crtendS.o"
131 // PIE: "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
133 // X86_64: "-cc1" "-triple" "x86_64-unknown-netbsd"
134 // X86_64-NOT: "-fno-use-init-array"
135 // X86_64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
136 // X86_64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
137 // X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
138 // X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
140 // AARCH64: "-cc1" "-triple" "aarch64-unknown-netbsd"
141 // AARCH64-NOT: "-fno-use-init-array"
142 // AARCH64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
143 // AARCH64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
144 // AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
145 // AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
147 // AARCH64_BE: "-cc1" "-triple" "aarch64_be-unknown-netbsd"
148 // AARCH64_BE-NOT: "-fno-use-init-array"
149 // AARCH64_BE: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
150 // AARCH64_BE: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
151 // AARCH64_BE: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
152 // AARCH64_BE: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
154 // ARM: "-cc1" "-triple" "armv5e-unknown-netbsd-eabi"
155 // ARM-NOT: "-fno-use-init-array"
156 // ARM: as{{.*}}" "-mcpu=arm926ej-s" "-o"
157 // ARM: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
158 // ARM: "-m" "armelf_nbsd_eabi"
159 // ARM: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
160 // ARM: "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o"
161 // ARM: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
162 // ARM: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
164 // ARMEB: "-cc1" "-triple" "armebv5e-unknown-netbsd-eabi"
165 // ARMEB-NOT: "-fno-use-init-array"
166 // ARMEB: as{{.*}}" "-mcpu=arm926ej-s" "-o"
167 // ARMEB: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
168 // ARMEB-NOT: "--be8"
169 // ARMEB: "-m" "armelfb_nbsd_eabi"
170 // ARMEB: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
171 // ARMEB: "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o"
172 // ARMEB: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
173 // ARMEB: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
174 // ARMV7EB: as{{.*}}" "-mcpu=cortex-a8"
175 // ARMV7EB: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
176 // ARMV7EB: "--be8" "-m" "armelfb_nbsd_eabi"
178 // ARMEB-R: ld{{.*}}"
179 // ARMEB-R-NOT: "--be8"
181 // ARM-APCS: "-cc1" "-triple" "armv4-unknown-netbsd"
182 // ARM-APCS: as{{.*}}" "-mcpu=strongarm" "-o"
183 // ARM-APCS: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
184 // ARM-APCS: "-m" "armelf_nbsd"
185 // ARM-APCS: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
186 // ARM-APCS: "{{.*}}/usr/lib{{/|\\\\}}oabi{{/|\\\\}}crti.o"
187 // ARM-APCS: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
188 // ARM-APCS: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
190 // ARM-HF: "-cc1" "-triple" "armv5e-unknown-netbsd-eabihf"
191 // ARM-HF: as{{.*}}" "-mcpu=arm926ej-s" "-o"
192 // ARM-HF: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
193 // ARM-HF: "-m" "armelf_nbsd_eabihf"
194 // ARM-HF: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
195 // ARM-HF: "{{.*}}/usr/lib{{/|\\\\}}eabihf{{/|\\\\}}crti.o"
196 // ARM-HF: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
197 // ARM-HF: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
199 // THUMB: "-cc1" "-triple" "armv5e-unknown-netbsd-eabi"
200 // THUMB: as{{.*}}" "-mcpu=arm926ej-s" "-o"
201 // THUMB: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
202 // THUMB: "-m" "armelf_nbsd_eabi"
203 // THUMB: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
204 // THUMB: "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o"
205 // THUMB: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
206 // THUMB: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
208 // THUMBEB: "-cc1" "-triple" "armebv5e-unknown-netbsd-eabi"
209 // THUMBEB: as{{.*}}" "-mcpu=arm926ej-s" "-o"
210 // THUMBEB: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
211 // THUMBEB: "-m" "armelfb_nbsd_eabi"
212 // THUMBEB: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
213 // THUMBEB: "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o"
214 // THUMBEB: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
215 // THUMBEB: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
217 // RISCV32: "-cc1" "-triple" "riscv32-unknown-netbsd"
218 // RISCV32-NOT: "-fno-use-init-array"
219 // RISCV32: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
220 // RISCV32-SAME: "-m" "elf32lriscv" "-X"
221 // RISCV32-SAME: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
222 // RISCV32-SAME: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
223 // RISCV32-SAME: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
225 // RISCV64: "-cc1" "-triple" "riscv64-unknown-netbsd"
226 // RISCV64-NOT: "-fno-use-init-array"
227 // RISCV64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
228 // RISCV64-SAME: "-m" "elf64lriscv" "-X"
229 // RISCV64-SAME: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
230 // RISCV64-SAME: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
231 // RISCV64-SAME: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
233 // SPARC: "-cc1" "-triple" "sparc-unknown-netbsd"
234 // SPARC-NOT: "-fno-use-init-array"
235 // SPARC: as{{.*}}" "-32" "-Av8" "-o"
236 // SPARC: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
237 // SPARC: "-m" "elf32_sparc"
238 // SPARC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
239 // SPARC: "{{.*}}/usr/lib{{/|\\\\}}sparc{{/|\\\\}}crti.o"
240 // SPARC: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
241 // SPARC: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
243 // SPARC64: "-cc1" "-triple" "sparc64-unknown-netbsd"
244 // SPARC64-NOT: "-fno-use-init-array"
245 // SPARC64: as{{.*}}" "-64" "-Av9" "-o"
246 // SPARC64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
247 // SPARC64: "-m" "elf64_sparc"
248 // SPARC64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
249 // SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
250 // SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
252 // POWERPC: "-cc1" "-triple" "powerpc-unknown-netbsd"
253 // POWERPC-NOT: "-fno-use-init-array"
254 // POWERPC: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
255 // POWERPC: "-m" "elf32ppc_nbsd"
256 // POWERPC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
257 // POWERPC: "{{.*}}/usr/lib{{/|\\\\}}powerpc{{/|\\\\}}crti.o"
258 // POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
259 // POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
261 // POWERPC64: "-cc1" "-triple" "powerpc64-unknown-netbsd"
262 // POWERPC64-NOT: "-fno-use-init-array"
263 // POWERPC64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
264 // POWERPC64: "-m" "elf64ppc"
265 // POWERPC64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
266 // POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crti.o"
267 // POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
268 // POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
270 // S-X86_64: "-cc1" "-triple" "x86_64-unknown-netbsd"
271 // S-X86_64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
272 // S-X86_64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
273 // S-X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
274 // S-X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
276 // S-AARCH64: "-cc1" "-triple" "aarch64-unknown-netbsd"
277 // S-AARCH64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
278 // S-AARCH64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
279 // S-AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
280 // S-AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
282 // S-AARCH64_BE: "-cc1" "-triple" "aarch64_be-unknown-netbsd"
283 // S-AARCH64_BE: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
284 // S-AARCH64_BE: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
285 // S-AARCH64_BE: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
286 // S-AARCH64_BE: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
288 // S-ARM: "-cc1" "-triple" "armv5e-unknown-netbsd-eabi"
289 // S-ARM: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
290 // S-ARM: "-m" "armelf_nbsd_eabi"
291 // S-ARM: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
292 // S-ARM: "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o"
293 // S-ARM: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
294 // S-ARM: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
296 // S-ARMEB: "-cc1" "-triple" "armebv5e-unknown-netbsd-eabi"
297 // S-ARMEB: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
298 // S-ARMEB: "-m" "armelfb_nbsd_eabi"
299 // S-ARMEB: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
300 // S-ARMEB: "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o"
301 // S-ARMEB: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
302 // S-ARMEB: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
304 // S-POWERPC: "-cc1" "-triple" "powerpc-unknown-netbsd"
305 // S-POWERPC: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
306 // S-POWERPC: "-m" "elf32ppc_nbsd"
307 // S-POWERPC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
308 // S-POWERPC: "{{.*}}/usr/lib{{/|\\\\}}powerpc{{/|\\\\}}crti.o"
309 // S-POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
310 // S-POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
312 // S-POWERPC64: "-cc1" "-triple" "powerpc64-unknown-netbsd"
313 // S-POWERPC64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
314 // S-POWERPC64: "-m" "elf64ppc"
315 // S-POWERPC64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
316 // S-POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crti.o"
317 // S-POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
318 // S-POWERPC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
320 // PTHREAD-NOT: _POSIX_THREADS
321 // PTHREAD: _REENTRANT
322 // PTHREAD-NOT: _POSIX_THREADS
324 // Check PowerPC for Secure PLT
325 // RUN: %clang --target=powerpc-unknown-netbsd -### -c %s 2>&1 \
326 // RUN: | FileCheck -check-prefix=POWERPC-SECUREPLT %s
327 // POWERPC-SECUREPLT: "-target-feature" "+secure-plt"
329 // -r suppresses -dynamic-linker, default -l and crt*.o like -nostdlib.
330 // RUN: %clang --target=x86_64-unknown-netbsd -r \
331 // RUN: --sysroot=%S/Inputs/basic_netbsd_tree -### %s 2>&1 \
332 // RUN: | FileCheck -check-prefix=RELOCATABLE %s
334 // RELOCATABLE-NOT: "-pie"
335 // RELOCATABLE-NOT: "-dynamic-linker"
336 // RELOCATABLE-NOT: "-l
337 // RELOCATABLE-NOT: crt{{[^./\\]+}}.o
339 // Check that the driver passes include paths to cc1 on NetBSD.
340 // RUN: %clang -### %s --target=x86_64-unknown-netbsd -r 2>&1 \
341 // RUN: | FileCheck %s --check-prefix=DRIVER-PASS-INCLUDES
342 // DRIVER-PASS-INCLUDES: "-cc1" {{.*}}"-resource-dir" "[[RESOURCE:[^"]+]]"
343 // DRIVER-PASS-INCLUDES-SAME: "-internal-isystem" "[[RESOURCE]]{{/|\\\\}}include"
344 // DRIVER-PASS-INCLUDES-SAME: {{^}} "-internal-externc-isystem" "{{.*}}/usr/include"
346 // Check that the -X and --no-relax flags are passed to the linker on riscv
347 // RUN: %clang --target=riscv32-unknown-netbsd -mno-relax -### %s 2>&1 \
348 // RUN: | FileCheck -check-prefix=RISCV-FLAGS %s
349 // RUN: %clang --target=riscv64-unknown-netbsd -mno-relax -### %s 2>&1 \
350 // RUN: | FileCheck -check-prefix=RISCV-FLAGS %s
351 // RISCV-FLAGS: "-X" "--no-relax"