[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Driver / pic.c
blobb05f363603a2a737bc2f07767bd48fd5a95c4117
1 // Test the driver's control over the PIC behavior. These mainly consist of
2 // tests of the relocation model flags and the pic level flags passed to CC1.
3 //
4 // CHECK-NO-PIC: "-mrelocation-model" "static"
5 // CHECK-NO-PIC-NOT: "-pic-level"
6 // CHECK-NO-PIC-NOT: "-pic-is-pie"
7 //
8 // CHECK-PIC1: "-mrelocation-model" "pic"
9 // CHECK-PIC1: "-pic-level" "1"
10 // CHECK-PIC1-NOT: "-pic-is-pie"
12 // CHECK-PIC2: "-mrelocation-model" "pic"
13 // CHECK-PIC2: "-pic-level" "2"
14 // CHECK-PIC2-NOT: "-pic-is-pie"
16 // CHECK-STATIC: "-static"
17 // CHECK-NO-STATIC-NOT: "-static"
19 // CHECK-PIE1: "-mrelocation-model" "pic"
20 // CHECK-PIE1: "-pic-level" "1"
21 // CHECK-PIE1: "-pic-is-pie"
23 // CHECK-PIE2: "-mrelocation-model" "pic"
24 // CHECK-PIE2: "-pic-level" "2"
25 // CHECK-PIE2: "-pic-is-pie"
27 // CHECK-PIE-LD: "{{.*}}ld{{(.exe)?}}"
28 // CHECK-PIE-LD: "-pie"
29 // CHECK-PIE-LD: "Scrt1.o" "crti.o" "crtbeginS.o"
30 // CHECK-PIE-LD: "crtendS.o" "crtn.o"
32 // CHECK-NOPIE-LD: "-nopie"
34 // CHECK-DYNAMIC-NO-PIC-32: "-mrelocation-model" "dynamic-no-pic"
35 // CHECK-DYNAMIC-NO-PIC-32-NOT: "-pic-level"
36 // CHECK-DYNAMIC-NO-PIC-32-NOT: "-pic-is-pie"
38 // CHECK-DYNAMIC-NO-PIC-64: "-mrelocation-model" "dynamic-no-pic"
39 // CHECK-DYNAMIC-NO-PIC-64: "-pic-level" "2"
40 // CHECK-DYNAMIC-NO-PIC-64-NOT: "-pic-is-pie"
42 // CHECK-NON-DARWIN-DYNAMIC-NO-PIC: error: unsupported option '-mdynamic-no-pic' for target 'i386-unknown-unknown'
44 // CHECK-NO-PIE-NOT: "-pie"
46 // CHECK-NO-UNUSED-ARG-NOT: argument unused during compilation
48 // CHECK-NO-PIC-DATA-TEXT-REL: "-mcmodel=medium"
49 // CHECK-PIC-DATA-TEXT-REL-NOT: "-mcmodel=medium"
50 // CHECK-NO-PIC-DATA-TEXT-REL-NON-SYSTEMZ: error: unsupported option '-mno-pic-data-is-text-relative' for target 'arm-arm-none-eabi'
51 // CHECK-PIC-DATA-TEXT-REL-NON-SYSTEMZ: error: unsupported option '-mpic-data-is-text-relative' for target 'arm-arm-none-eabi'
53 // RUN: %clang -c %s -target i386-unknown-unknown -### 2>&1 \
54 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
55 // RUN: %clang -c %s -target i386-unknown-unknown -fpic -### 2>&1 \
56 // RUN: | FileCheck %s --check-prefix=CHECK-PIC1
57 // RUN: %clang -c %s -target i386-unknown-unknown -fPIC -### 2>&1 \
58 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
59 // RUN: %clang -c %s -target i386-unknown-unknown -fpie -### 2>&1 \
60 // RUN: | FileCheck %s --check-prefix=CHECK-PIE1
61 // RUN: %clang -c %s -target i386-unknown-unknown -fPIE -### 2>&1 \
62 // RUN: | FileCheck %s --check-prefix=CHECK-PIE2
64 // Check that PIC and PIE flags obey last-match-wins. If the last flag is
65 // a no-* variant, regardless of which variant or which flags precede it, we
66 // get no PIC.
67 // RUN: %clang -c %s -target i386-unknown-unknown -fpic -fno-pic -### 2>&1 \
68 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
69 // RUN: %clang -c %s -target i386-unknown-unknown -fPIC -fno-pic -### 2>&1 \
70 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
71 // RUN: %clang -c %s -target i386-unknown-unknown -fpie -fno-pic -### 2>&1 \
72 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
73 // RUN: %clang -c %s -target i386-unknown-unknown -fPIE -fno-pic -### 2>&1 \
74 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
75 // RUN: %clang -c %s -target i386-unknown-unknown -fpic -fno-PIC -### 2>&1 \
76 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
77 // RUN: %clang -c %s -target i386-unknown-unknown -fPIC -fno-PIC -### 2>&1 \
78 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
79 // RUN: %clang -c %s -target i386-unknown-unknown -fpie -fno-PIC -### 2>&1 \
80 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
81 // RUN: %clang -c %s -target i386-unknown-unknown -fPIE -fno-PIC -### 2>&1 \
82 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
83 // RUN: %clang -c %s -target i386-unknown-unknown -fpic -fno-pie -### 2>&1 \
84 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
85 // RUN: %clang -c %s -target i386-unknown-unknown -fPIC -fno-pie -### 2>&1 \
86 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
87 // RUN: %clang -c %s -target i386-unknown-unknown -fpie -fno-pie -### 2>&1 \
88 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
89 // RUN: %clang -c %s -target i386-unknown-unknown -fPIE -fno-pie -### 2>&1 \
90 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
91 // RUN: %clang -c %s -target i386-unknown-unknown -fpic -fno-PIE -### 2>&1 \
92 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
93 // RUN: %clang -c %s -target i386-unknown-unknown -fPIC -fno-PIE -### 2>&1 \
94 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
95 // RUN: %clang -c %s -target i386-unknown-unknown -fpie -fno-PIE -### 2>&1 \
96 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
97 // RUN: %clang -c %s -target i386-unknown-unknown -fPIE -fno-PIE -### 2>&1 \
98 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
100 // Last-match-wins where both pic and pie are specified.
101 // RUN: %clang -c %s -target i386-unknown-unknown -fpie -fpic -### 2>&1 \
102 // RUN: | FileCheck %s --check-prefix=CHECK-PIC1
103 // RUN: %clang -c %s -target i386-unknown-unknown -fPIE -fpic -### 2>&1 \
104 // RUN: | FileCheck %s --check-prefix=CHECK-PIC1
105 // RUN: %clang -c %s -target i386-unknown-unknown -fpie -fPIC -### 2>&1 \
106 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
107 // RUN: %clang -c %s -target i386-unknown-unknown -fPIE -fPIC -### 2>&1 \
108 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
109 // RUN: %clang -c %s -target i386-unknown-unknown -fpic -fpie -### 2>&1 \
110 // RUN: | FileCheck %s --check-prefix=CHECK-PIE1
111 // RUN: %clang -c %s -target i386-unknown-unknown -fPIC -fpie -### 2>&1 \
112 // RUN: | FileCheck %s --check-prefix=CHECK-PIE1
113 // RUN: %clang -c %s -target i386-unknown-unknown -fpic -fPIE -### 2>&1 \
114 // RUN: | FileCheck %s --check-prefix=CHECK-PIE2
115 // RUN: %clang -c %s -target i386-unknown-unknown -fPIC -fPIE -### 2>&1 \
116 // RUN: | FileCheck %s --check-prefix=CHECK-PIE2
118 // Last-match-wins when selecting level 1 vs. level 2.
119 // RUN: %clang -c %s -target i386-unknown-unknown -fpic -fPIC -### 2>&1 \
120 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
121 // RUN: %clang -c %s -target i386-unknown-unknown -fPIC -fpic -### 2>&1 \
122 // RUN: | FileCheck %s --check-prefix=CHECK-PIC1
123 // RUN: %clang -c %s -target i386-unknown-unknown -fpic -fPIE -fpie -### 2>&1 \
124 // RUN: | FileCheck %s --check-prefix=CHECK-PIE1
125 // RUN: %clang -c %s -target i386-unknown-unknown -fpie -fPIC -fPIE -### 2>&1 \
126 // RUN: | FileCheck %s --check-prefix=CHECK-PIE2
128 // Make sure -pie is passed to along to ld and that the right *crt* files
129 // are linked in.
130 // RUN: %clang %s -target i386-unknown-freebsd -fPIE -pie -### \
131 // RUN: --gcc-toolchain="" -rtlib=platform \
132 // RUN: --sysroot=%S/Inputs/basic_freebsd_tree 2>&1 \
133 // RUN: | FileCheck %s --check-prefix=CHECK-PIE-LD
134 // RUN: %clang %s -target i386-linux-gnu -fPIE -pie -### \
135 // RUN: --gcc-toolchain="" -rtlib=platform \
136 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
137 // RUN: | FileCheck %s --check-prefix=CHECK-PIE-LD
138 // RUN: %clang %s -target i386-linux-gnu -fPIC -pie -### \
139 // RUN: --gcc-toolchain="" -rtlib=platform \
140 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
141 // RUN: | FileCheck %s --check-prefix=CHECK-PIE-LD
143 // Disregard any of the PIC-specific flags if we have a trump-card flag.
144 // RUN: %clang -c %s -target i386-unknown-unknown -mkernel -fPIC -### 2>&1 \
145 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
147 // The -static argument *doesn't* override PIC: -static only affects
148 // linking, and -fPIC only affects code generation.
149 // RUN: %clang -c %s -target i386-unknown-unknown -static -fPIC -### 2>&1 \
150 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
151 // RUN: %clang %s -target i386-linux-gnu -static -fPIC -### \
152 // RUN: --gcc-toolchain="" \
153 // RUN: --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
154 // RUN: | FileCheck %s --check-prefix=CHECK-STATIC
156 // On Linux, disregard -pie if we have -shared.
157 // RUN: %clang %s -target i386-unknown-linux -shared -pie -### 2>&1 \
158 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIE
160 // On Musl Linux, PIE is enabled by default, but can be disabled.
161 // RUN: %clang -c %s -target x86_64-linux-musl -### 2>&1 \
162 // RUN: | FileCheck %s --check-prefix=CHECK-PIE2
163 // RUN: %clang -c %s -target i686-linux-musl -### 2>&1 \
164 // RUN: | FileCheck %s --check-prefix=CHECK-PIE2
165 // RUN: %clang -c %s -target armv6-linux-musleabihf -### 2>&1 \
166 // RUN: | FileCheck %s --check-prefix=CHECK-PIE2
167 // RUN: %clang -c %s -target armv7-linux-musleabihf -### 2>&1 \
168 // RUN: | FileCheck %s --check-prefix=CHECK-PIE2
169 // RUN: %clang %s -target x86_64-linux-musl -nopie -### 2>&1 \
170 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIE
171 // RUN: %clang %s -target x86_64-linux-musl -pie -nopie -### 2>&1 \
172 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIE
173 // RUN: %clang %s -target x86_64-linux-musl -nopie -pie -### 2>&1 \
174 // RUN: | FileCheck %s --check-prefix=CHECK-PIE2
176 // Darwin is a beautiful and unique snowflake when it comes to these flags.
177 // When targeting a 32-bit darwin system, only level 2 is supported. On 64-bit
178 // targets, there is simply nothing you can do, there is no PIE, there is only
179 // PIC when it comes to compilation.
180 // RUN: %clang -c %s -target i386-apple-darwin -### 2>&1 \
181 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
182 // RUN: %clang -c %s -target i386-apple-darwin -fpic -### 2>&1 \
183 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
184 // RUN: %clang -c %s -target i386-apple-darwin -fPIC -### 2>&1 \
185 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
186 // RUN: %clang -c %s -target i386-apple-darwin -fpie -### 2>&1 \
187 // RUN: | FileCheck %s --check-prefix=CHECK-PIE2
188 // RUN: %clang -c %s -target i386-apple-darwin -fPIE -### 2>&1 \
189 // RUN: | FileCheck %s --check-prefix=CHECK-PIE2
190 // RUN: %clang -c %s -target i386-apple-darwin -fno-PIC -### 2>&1 \
191 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
192 // RUN: %clang -c %s -target i386-apple-darwin -fno-PIE -### 2>&1 \
193 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
194 // RUN: %clang -c %s -target i386-apple-darwin -fno-PIC -fpic -### 2>&1 \
195 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
196 // RUN: %clang -c %s -target i386-apple-darwin -fno-PIC -fPIE -### 2>&1 \
197 // RUN: | FileCheck %s --check-prefix=CHECK-PIE2
198 // RUN: %clang -c %s -target x86_64-apple-darwin -fno-PIC -### 2>&1 \
199 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
200 // RUN: %clang -c %s -target x86_64-apple-darwin -fno-PIE -### 2>&1 \
201 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
202 // RUN: %clang -c %s -target x86_64-apple-darwin -fpic -### 2>&1 \
203 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
204 // RUN: %clang -c %s -target x86_64-apple-darwin -fPIE -### 2>&1 \
205 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
206 // RUN: %clang -c %s -target x86_64-apple-darwin -fPIC -### 2>&1 \
207 // RUN: | FileCheck %s --check-prefix=CHECK-NO-UNUSED-ARG
209 // Darwin gets even more special with '-mdynamic-no-pic'. This flag is only
210 // valid on Darwin, and it's behavior is very strange but needs to remain
211 // consistent for compatibility.
212 // RUN: %clang -c %s -target i386-unknown-unknown -mdynamic-no-pic -### 2>&1 \
213 // RUN: | FileCheck %s --check-prefix=CHECK-NON-DARWIN-DYNAMIC-NO-PIC
214 // RUN: %clang -c %s -target i386-apple-darwin -mdynamic-no-pic -### 2>&1 \
215 // RUN: | FileCheck %s --check-prefix=CHECK-DYNAMIC-NO-PIC-32
216 // RUN: %clang -c %s -target i386-apple-darwin -mdynamic-no-pic -fno-pic -### 2>&1 \
217 // RUN: | FileCheck %s --check-prefix=CHECK-DYNAMIC-NO-PIC-32
218 // RUN: %clang -c %s -target i386-apple-darwin -mdynamic-no-pic -fpie -### 2>&1 \
219 // RUN: | FileCheck %s --check-prefix=CHECK-DYNAMIC-NO-PIC-32
220 // RUN: %clang -c %s -target x86_64-apple-darwin -mdynamic-no-pic -### 2>&1 \
221 // RUN: | FileCheck %s --check-prefix=CHECK-DYNAMIC-NO-PIC-64
222 // RUN: %clang -c %s -target x86_64-apple-darwin -mdynamic-no-pic -fno-pic -### 2>&1 \
223 // RUN: | FileCheck %s --check-prefix=CHECK-DYNAMIC-NO-PIC-64
224 // RUN: %clang -c %s -target x86_64-apple-darwin -mdynamic-no-pic -fpie -### 2>&1 \
225 // RUN: | FileCheck %s --check-prefix=CHECK-DYNAMIC-NO-PIC-64
227 // Checks for ARM+Apple+IOS including -fapple-kext, -mkernel, and iphoneos
228 // version boundaries.
229 // RUN: %clang -c %s -target armv7-apple-ios6 -fapple-kext -### 2>&1 \
230 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
231 // RUN: %clang -c %s -target armv7-apple-ios6 -mkernel -### 2>&1 \
232 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
233 // RUN: %clang -c %s -target arm64-apple-ios7 -mkernel -### 2>&1 \
234 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
235 // RUN: %clang -x assembler -c %s -target arm64-apple-ios7 -mkernel -no-integrated-as -### 2>&1 \
236 // RUN: | FileCheck %s --check-prefix=CHECK-NO-STATIC
237 // RUN: %clang -c %s -target armv7k-apple-watchos1 -fapple-kext -### 2>&1 \
238 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
239 // RUN: %clang -c %s -target x86_64-apple-driverkit -fapple-kext -### 2>&1 \
240 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
241 // RUN: %clang -c %s -target armv7-apple-ios5 -fapple-kext -### 2>&1 \
242 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
243 // RUN: %clang -c %s -target armv7-apple-ios6 -fapple-kext -static -### 2>&1 \
244 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
245 // RUN: %clang -c %s -target armv7-apple-unknown-macho -static -### 2>&1 \
246 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
248 // On OpenBSD, PIE is enabled by default, but can be disabled.
249 // RUN: %clang -c %s -target amd64-pc-openbsd -### 2>&1 \
250 // RUN: | FileCheck %s --check-prefix=CHECK-PIE1
251 // RUN: %clang -c %s -target i386-pc-openbsd -### 2>&1 \
252 // RUN: | FileCheck %s --check-prefix=CHECK-PIE1
253 // RUN: %clang -c %s -target aarch64-unknown-openbsd -### 2>&1 \
254 // RUN: | FileCheck %s --check-prefix=CHECK-PIE1
255 // RUN: %clang -c %s -target arm-unknown-openbsd -### 2>&1 \
256 // RUN: | FileCheck %s --check-prefix=CHECK-PIE1
257 // RUN: %clang -c %s -target mips64-unknown-openbsd -### 2>&1 \
258 // RUN: | FileCheck %s --check-prefix=CHECK-PIE1
259 // RUN: %clang -c %s -target mips64el-unknown-openbsd -### 2>&1 \
260 // RUN: | FileCheck %s --check-prefix=CHECK-PIE1
261 // RUN: %clang -c %s -target powerpc-unknown-openbsd -### 2>&1 \
262 // RUN: | FileCheck %s --check-prefix=CHECK-PIE2
263 // RUN: %clang -c %s -target sparc64-unknown-openbsd -### 2>&1 \
264 // RUN: | FileCheck %s --check-prefix=CHECK-PIE2
265 // RUN: %clang -c %s -target i386-pc-openbsd -fno-pie -### 2>&1 \
266 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
268 // On OpenBSD, -nopie needs to be passed through to the linker.
269 // RUN: %clang %s -target i386-pc-openbsd -nopie -### 2>&1 \
270 // RUN: | FileCheck %s --check-prefix=CHECK-NOPIE-LD
271 // Try with the alias
272 // RUN: %clang %s -target i386-pc-openbsd -no-pie -### 2>&1 \
273 // RUN: | FileCheck %s --check-prefix=CHECK-NOPIE-LD
275 // On Android PIC is enabled by default, and PIE is enabled by default starting
276 // with API16.
277 // RUN: %clang -c %s -target i686-linux-android24 -### 2>&1 \
278 // RUN: | FileCheck %s --check-prefix=CHECK-PIE2
280 // RUN: %clang -c %s -target arm-linux-androideabi24 -### 2>&1 \
281 // RUN: | FileCheck %s --check-prefix=CHECK-PIE2
283 // RUN: %clang -c %s -target mipsel-linux-android24 -### 2>&1 \
284 // RUN: | FileCheck %s --check-prefix=CHECK-PIE1
286 // 64-bit Android targets are always PIE.
287 // RUN: %clang -c %s -target aarch64-linux-android -### 2>&1 \
288 // RUN: | FileCheck %s --check-prefix=CHECK-PIE2
289 // RUN: %clang -c %s -target aarch64-linux-android24 -### 2>&1 \
290 // RUN: | FileCheck %s --check-prefix=CHECK-PIE2
291 // RUN: %clang -c %s -target arm64-linux-android -### 2>&1 \
292 // RUN: | FileCheck %s --check-prefix=CHECK-PIE2
294 // Default value of PIE can be overwritten, even on 64-bit targets.
295 // RUN: %clang -c %s -target arm-linux-androideabi -fPIE -### 2>&1 \
296 // RUN: | FileCheck %s --check-prefix=CHECK-PIE2
297 // RUN: %clang -c %s -target aarch64-linux-android -fno-PIE -### 2>&1 \
298 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
299 // RUN: %clang -c %s -target aarch64-linux-android24 -fno-PIE -### 2>&1 \
300 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
302 // On Windows x86_64 and aarch64 PIC is enabled by default
303 // RUN: %clang -c %s -target x86_64-pc-windows-msvc18.0.0 -### 2>&1 \
304 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
305 // RUN: %clang -c %s -target x86_64-pc-windows-gnu -### 2>&1 \
306 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
307 // RUN: %clang -c %s -target aarch64-windows-msvc -### 2>&1 \
308 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
309 // RUN: %clang -c %s -target aarch64-windows-gnu -### 2>&1 \
310 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
312 // On MinGW, allow specifying -fPIC & friends but ignore them
313 // RUN: %clang -fno-PIC -c %s -target x86_64-pc-windows-gnu -### 2>&1 \
314 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
315 // RUN: %clang -fPIC -c %s -target i686-pc-windows-gnu -### 2>&1 \
316 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
317 // RUN: %clang -fno-PIC -c %s -target aarch64-pc-windows-gnu -### 2>&1 \
318 // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
319 // RUN: %clang -fPIC -c %s -target armv7-pc-windows-gnu -### 2>&1 \
320 // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC
322 // RUN: %clang -fpic -c --target=s390x-linux-gnu -mno-pic-data-is-text-relative %s \
323 // RUN: -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIC-DATA-TEXT-REL
324 // RUN: %clang -fpic -c --target=s390x-linux-gnu -mpic-data-is-text-relative %s -### \
325 // RUN: 2>&1 | FileCheck %s --check-prefix=CHECK-PIC-DATA-TEXT-REL
326 // RUN: %clang -fpic -c --target=arm-arm-none-eabi -mno-pic-data-is-text-relative %s \
327 // RUN: -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-PIC-DATA-TEXT-REL-NON-SYSTEMZ
328 // RUN: %clang -fpic -c --target=arm-arm-none-eabi -mpic-data-is-text-relative %s \
329 // RUN: -### 2>&1 | FileCheck %s --check-prefix=CHECK-PIC-DATA-TEXT-REL-NON-SYSTEMZ