[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Driver / linux-header-search.cpp
blob91e4f8825e49a9dd00ed9a3262b2e523ba8d4f55
1 // General tests that the header search paths detected by the driver and passed
2 // to CC1 are sane.
3 //
4 // Test a simulated installation of libc++ on Linux, both through sysroot and
5 // the installation path of Clang.
6 // RUN: %clang -### %s -fsyntax-only 2>&1 \
7 // RUN: --target=x86_64-unknown-linux-gnu \
8 // RUN: -stdlib=libc++ \
9 // RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \
10 // RUN: -resource-dir=%S/Inputs/resource_dir \
11 // RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree \
12 // RUN: --gcc-toolchain="" \
13 // RUN: | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-SYSROOT %s
14 // CHECK-BASIC-LIBCXX-SYSROOT: "-cc1"
15 // CHECK-BASIC-LIBCXX-SYSROOT: "-isysroot" "[[SYSROOT:[^"]+]]"
16 // CHECK-BASIC-LIBCXX-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/include/x86_64-unknown-linux-gnu/c++/v1"
17 // CHECK-BASIC-LIBCXX-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v1"
18 // CHECK-BASIC-LIBCXX-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
20 // Test include paths when the sysroot path ends with `/`.
21 // RUN: %clang -### %s -fsyntax-only 2>&1 \
22 // RUN: --target=x86_64-unknown-linux-gnu \
23 // RUN: -stdlib=libc++ \
24 // RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \
25 // RUN: -resource-dir=%S/Inputs/resource_dir \
26 // RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree/ \
27 // RUN: --gcc-toolchain="" \
28 // RUN: | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-SYSROOT-SLASH %s
29 // CHECK-BASIC-LIBCXX-SYSROOT-SLASH: "-cc1"
30 // CHECK-BASIC-LIBCXX-SYSROOT-SLASH-SAME: "-isysroot" "[[SYSROOT:[^"]+/]]"
31 // CHECK-BASIC-LIBCXX-SYSROOT-SLASH-SAME: "-internal-isystem" "[[SYSROOT]]usr/include/x86_64-unknown-linux-gnu/c++/v1"
32 // CHECK-BASIC-LIBCXX-SYSROOT-SLASH-SAME: "-internal-isystem" "[[SYSROOT]]usr/include/c++/v1"
33 // CHECK-BASIC-LIBCXX-SYSROOT-SLASH-SAME: "-internal-isystem" "[[SYSROOT]]usr/local/include"
35 // RUN: %clang -### %s -fsyntax-only 2>&1 \
36 // RUN: --target=x86_64-unknown-linux-gnu \
37 // RUN: -stdlib=libc++ \
38 // RUN: -ccc-install-dir %S/Inputs/basic_linux_libcxx_tree/usr/bin \
39 // RUN: -resource-dir=%S/Inputs/resource_dir \
40 // RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree \
41 // RUN: --gcc-toolchain="" \
42 // RUN: | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-INSTALL %s
43 // CHECK-BASIC-LIBCXX-INSTALL: "-cc1"
44 // CHECK-BASIC-LIBCXX-INSTALL: "-isysroot" "[[SYSROOT:[^"]+]]"
45 // CHECK-BASIC-LIBCXX-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/bin/../include/x86_64-unknown-linux-gnu/c++/v1"
46 // CHECK-BASIC-LIBCXX-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/bin/../include/c++/v1"
47 // CHECK-BASIC-LIBCXX-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
49 // RUN: %clang -### %s -fsyntax-only 2>&1 \
50 // RUN: --target=x86_64-unknown-linux-gnu \
51 // RUN: -stdlib=libc++ \
52 // RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \
53 // RUN: -resource-dir=%S/Inputs/resource_dir \
54 // RUN: --sysroot=%S/Inputs/basic_linux_libcxxv2_tree \
55 // RUN: --gcc-toolchain="" \
56 // RUN: | FileCheck --check-prefix=CHECK-BASIC-LIBCXXV2-SYSROOT %s
57 // CHECK-BASIC-LIBCXXV2-SYSROOT: "-cc1"
58 // CHECK-BASIC-LIBCXXV2-SYSROOT: "-isysroot" "[[SYSROOT:[^"]+]]"
59 // CHECK-BASIC-LIBCXXV2-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/include/x86_64-unknown-linux-gnu/c++/v2"
60 // CHECK-BASIC-LIBCXXV2-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v2"
61 // CHECK-BASIC-LIBCXXV2-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
62 // RUN: %clang -### %s -fsyntax-only 2>&1 \
63 // RUN: --target=x86_64-unknown-linux-gnu \
64 // RUN: -stdlib=libc++ \
65 // RUN: -ccc-install-dir %S/Inputs/basic_linux_libcxxv2_tree/usr/bin \
66 // RUN: -resource-dir=%S/Inputs/resource_dir \
67 // RUN: --sysroot=%S/Inputs/basic_linux_libcxxv2_tree \
68 // RUN: --gcc-toolchain="" \
69 // RUN: | FileCheck --check-prefix=CHECK-BASIC-LIBCXXV2-INSTALL %s
70 // CHECK-BASIC-LIBCXXV2-INSTALL: "-cc1"
71 // CHECK-BASIC-LIBCXXV2-INSTALL: "-isysroot" "[[SYSROOT:[^"]+]]"
72 // CHECK-BASIC-LIBCXXV2-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/bin/../include/x86_64-unknown-linux-gnu/c++/v2"
73 // CHECK-BASIC-LIBCXXV2-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/bin/../include/c++/v2"
74 // CHECK-BASIC-LIBCXXV2-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
76 // Test Linux with libstdc++ when the sysroot path ends with `/`.
77 // RUN: %clang -### %s -fsyntax-only 2>&1 \
78 // RUN: --target=x86_64-unknown-linux-gnu \
79 // RUN: -stdlib=libstdc++ \
80 // RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \
81 // RUN: -resource-dir=%S/Inputs/resource_dir \
82 // RUN: --sysroot=%S/Inputs/basic_linux_libstdcxx_tree/ \
83 // RUN: --gcc-toolchain="" \
84 // RUN: | FileCheck --check-prefix=CHECK-BASIC-LIBSTDCXX-SYSROOT-SLASH %s
85 // CHECK-BASIC-LIBSTDCXX-SYSROOT-SLASH: "-cc1"
86 // CHECK-BASIC-LIBSTDCXX-SYSROOT-SLASH-SAME: "-isysroot" "[[SYSROOT:[^"]+/]]"
87 // CHECK-BASIC-LIBSTDCXX-SYSROOT-SLASH-SAME: "-internal-isystem" "[[SYSROOT]]usr/lib/gcc/x86_64-unknown-linux-gnu/4.8/../../../../x86_64-unknown-linux-gnu/include"
89 // Test Linux with both libc++ and libstdc++ installed.
90 // RUN: %clang -### %s -fsyntax-only 2>&1 \
91 // RUN: --target=x86_64-unknown-linux-gnu \
92 // RUN: -stdlib=libc++ \
93 // RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \
94 // RUN: -resource-dir=%S/Inputs/resource_dir \
95 // RUN: --sysroot=%S/Inputs/basic_linux_libstdcxx_libcxxv2_tree \
96 // RUN: --gcc-toolchain="" \
97 // RUN: | FileCheck --check-prefix=CHECK-BASIC-LIBSTDCXX-LIBCXXV2-SYSROOT %s
98 // CHECK-BASIC-LIBSTDCXX-LIBCXXV2-SYSROOT: "-cc1"
99 // CHECK-BASIC-LIBSTDCXX-LIBCXXV2-SYSROOT: "-isysroot" "[[SYSROOT:[^"]+]]"
100 // CHECK-BASIC-LIBSTDCXX-LIBCXXV2-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/include/x86_64-unknown-linux-gnu/c++/v2"
101 // CHECK-BASIC-LIBSTDCXX-LIBCXXV2-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v2"
102 // CHECK-BASIC-LIBSTDCXX-LIBCXXV2-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
104 // Test Gentoo's weirdness both before and after they changed it in their GCC
105 // 4.6.4 release.
106 // RUN: %clang -### %s -fsyntax-only 2>&1 \
107 // RUN: --target=x86_64-unknown-linux-gnu -stdlib=libstdc++ \
108 // RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_4.6.2_tree \
109 // RUN: --gcc-toolchain="" \
110 // RUN: | FileCheck --check-prefix=CHECK-GENTOO-4-6-2 %s
111 // CHECK-GENTOO-4-6-2: "-cc1"
112 // CHECK-GENTOO-4-6-2: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
113 // CHECK-GENTOO-4-6-2: "-isysroot" "[[SYSROOT:[^"]+]]"
114 // CHECK-GENTOO-4-6-2: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/g++-v4"
115 // CHECK-GENTOO-4-6-2: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/g++-v4/x86_64-pc-linux-gnu"
116 // CHECK-GENTOO-4-6-2: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/g++-v4/backward"
117 // CHECK-GENTOO-4-6-2: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
118 // CHECK-GENTOO-4-6-2: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
119 // CHECK-GENTOO-4-6-2: "-internal-externc-isystem" "[[SYSROOT]]/include"
120 // CHECK-GENTOO-4-6-2: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
121 // RUN: %clang -### %s -fsyntax-only 2>&1 \
122 // RUN: --target=x86_64-unknown-linux-gnu -stdlib=libstdc++ \
123 // RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_4.6.4_tree \
124 // RUN: --gcc-toolchain="" \
125 // RUN: | FileCheck --check-prefix=CHECK-GENTOO-4-6-4 %s
126 // CHECK-GENTOO-4-6-4: "-cc1"
127 // CHECK-GENTOO-4-6-4: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
128 // CHECK-GENTOO-4-6-4: "-isysroot" "[[SYSROOT:[^"]+]]"
129 // CHECK-GENTOO-4-6-4: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/include/g++-v4.6"
130 // CHECK-GENTOO-4-6-4: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/include/g++-v4.6/x86_64-pc-linux-gnu"
131 // CHECK-GENTOO-4-6-4: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/include/g++-v4.6/backward"
132 // CHECK-GENTOO-4-6-4: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
133 // CHECK-GENTOO-4-6-4: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
134 // CHECK-GENTOO-4-6-4: "-internal-externc-isystem" "[[SYSROOT]]/include"
135 // CHECK-GENTOO-4-6-4: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
136 // RUN: %clang -### %s -fsyntax-only 2>&1 \
137 // RUN: --target=x86_64-unknown-linux-gnu -stdlib=libstdc++ \
138 // RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_4.9.3_tree \
139 // RUN: --gcc-toolchain="" \
140 // RUN: | FileCheck --check-prefix=CHECK-GENTOO-4-9-3 %s
141 // CHECK-GENTOO-4-9-3: "-cc1"
142 // CHECK-GENTOO-4-9-3: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
143 // CHECK-GENTOO-4-9-3: "-isysroot" "[[SYSROOT:[^"]+]]"
144 // CHECK-GENTOO-4-9-3: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3"
145 // CHECK-GENTOO-4-9-3: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/x86_64-pc-linux-gnu"
146 // CHECK-GENTOO-4-9-3: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/backward"
147 // CHECK-GENTOO-4-9-3: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
148 // CHECK-GENTOO-4-9-3: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
149 // CHECK-GENTOO-4-9-3: "-internal-externc-isystem" "[[SYSROOT]]/include"
150 // CHECK-GENTOO-4-9-3: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
152 // Test support for Gentoo's gcc-config -- clang should prefer the older
153 // (4.9.3) version over the newer (5.4.0) due to preference specified
154 // in /etc/env.d/gcc/x86_64-pc-linux-gnu.
155 // RUN: %clang -### %s -fsyntax-only 2>&1 \
156 // RUN: --target=x86_64-unknown-linux-gnu -stdlib=libstdc++ \
157 // RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_multi_version_tree \
158 // RUN: --gcc-toolchain="" \
159 // RUN: | FileCheck --check-prefix=CHECK-GENTOO-4-9-3 %s
161 // Test that gcc-config support does not break multilib.
162 // RUN: %clang -### %s -fsyntax-only 2>&1 \
163 // RUN: --target=x86_64-unknown-linux-gnux32 -stdlib=libstdc++ \
164 // RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_multi_version_tree \
165 // RUN: --gcc-toolchain="" \
166 // RUN: | FileCheck --check-prefix=CHECK-GENTOO-4-9-3-X32 %s
167 // CHECK-GENTOO-4-9-3-X32: "-cc1"
168 // CHECK-GENTOO-4-9-3-X32: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
169 // CHECK-GENTOO-4-9-3-X32: "-isysroot" "[[SYSROOT:[^"]+]]"
170 // CHECK-GENTOO-4-9-3-X32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3"
171 // CHECK-GENTOO-4-9-3-X32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/x86_64-pc-linux-gnu/x32"
172 // CHECK-GENTOO-4-9-3-X32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/backward"
173 // CHECK-GENTOO-4-9-3-X32: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
174 // CHECK-GENTOO-4-9-3-X32: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
175 // CHECK-GENTOO-4-9-3-X32: "-internal-externc-isystem" "[[SYSROOT]]/include"
176 // CHECK-GENTOO-4-9-3-X32: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
178 // RUN: %clang -### %s -fsyntax-only 2>&1 \
179 // RUN: --target=i386-unknown-linux-gnu -stdlib=libstdc++ \
180 // RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_multi_version_tree \
181 // RUN: --gcc-toolchain="" \
182 // RUN: | FileCheck --check-prefix=CHECK-GENTOO-4-9-3-32 %s
183 // CHECK-GENTOO-4-9-3-32: "-cc1"
184 // CHECK-GENTOO-4-9-3-32: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
185 // CHECK-GENTOO-4-9-3-32: "-isysroot" "[[SYSROOT:[^"]+]]"
186 // CHECK-GENTOO-4-9-3-32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3"
187 // CHECK-GENTOO-4-9-3-32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/x86_64-pc-linux-gnu/32"
188 // CHECK-GENTOO-4-9-3-32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/backward"
189 // CHECK-GENTOO-4-9-3-32: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
190 // CHECK-GENTOO-4-9-3-32: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
191 // CHECK-GENTOO-4-9-3-32: "-internal-externc-isystem" "[[SYSROOT]]/include"
192 // CHECK-GENTOO-4-9-3-32: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
194 // Test support for parsing Gentoo's gcc-config -- clang should parse the
195 // /etc/env.d/gcc/config-x86_64-pc-linux-gnu file to find CURRENT gcc used.
196 // Then should pick the multilibs from version 4.9.x specified in
197 // /etc/env.d/gcc/x86_64-pc-linux-gnu-4.9.3.
198 // RUN: %clang -### %s -fsyntax-only 2>&1 \
199 // RUN: --target=x86_64-unknown-linux-gnu -stdlib=libstdc++ \
200 // RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_4.9.x_tree \
201 // RUN: --gcc-toolchain="" \
202 // RUN: | FileCheck --check-prefix=CHECK-GENTOO-4-9-X %s
204 // CHECK-GENTOO-4-9-X: "-cc1"
205 // CHECK-GENTOO-4-9-X: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
206 // CHECK-GENTOO-4-9-X: "-isysroot" "[[SYSROOT:[^"]+]]"
207 // CHECK-GENTOO-4-9-X: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.x/include/g++-v4.9.3"
208 // CHECK-GENTOO-4-9-X: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.x/include/g++-v4.9.3/x86_64-pc-linux-gnu"
209 // CHECK-GENTOO-4-9-X: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.x/include/g++-v4.9.3/backward"
210 // CHECK-GENTOO-4-9-X: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
211 // CHECK-GENTOO-4-9-X: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
212 // CHECK-GENTOO-4-9-X: "-internal-externc-isystem" "[[SYSROOT]]/include"
213 // CHECK-GENTOO-4-9-X: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
215 // RUN: %clang -### %s -fsyntax-only 2>&1 \
216 // RUN: --target=x86_64-unknown-linux-gnux32 -stdlib=libstdc++ \
217 // RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_4.9.x_tree \
218 // RUN: --gcc-toolchain="" \
219 // RUN: | FileCheck --check-prefix=CHECK-GENTOO-4-9-X-X32 %s
220 // CHECK-GENTOO-4-9-X-X32: "-cc1"
221 // CHECK-GENTOO-4-9-X-X32: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
222 // CHECK-GENTOO-4-9-X-X32: "-isysroot" "[[SYSROOT:[^"]+]]"
223 // CHECK-GENTOO-4-9-X-X32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.x/include/g++-v4.9.3"
224 // CHECK-GENTOO-4-9-X-X32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.x/include/g++-v4.9.3/x86_64-pc-linux-gnu/x32"
225 // CHECK-GENTOO-4-9-X-X32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.x/include/g++-v4.9.3/backward"
226 // CHECK-GENTOO-4-9-X-X32: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
227 // CHECK-GENTOO-4-9-X-X32: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
228 // CHECK-GENTOO-4-9-X-X32: "-internal-externc-isystem" "[[SYSROOT]]/include"
229 // CHECK-GENTOO-4-9-X-X32: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
231 // RUN: %clang -### %s -fsyntax-only 2>&1 \
232 // RUN: --target=i386-unknown-linux-gnu -stdlib=libstdc++ \
233 // RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_4.9.x_tree \
234 // RUN: --gcc-toolchain="" \
235 // RUN: | FileCheck --check-prefix=CHECK-GENTOO-4-9-X-32 %s
236 // CHECK-GENTOO-4-9-X-32: "-cc1"
237 // CHECK-GENTOO-4-9-X-32: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
238 // CHECK-GENTOO-4-9-X-32: "-isysroot" "[[SYSROOT:[^"]+]]"
239 // CHECK-GENTOO-4-9-X-32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.x/include/g++-v4.9.3"
240 // CHECK-GENTOO-4-9-X-32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.x/include/g++-v4.9.3/x86_64-pc-linux-gnu/32"
241 // CHECK-GENTOO-4-9-X-32: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.x/include/g++-v4.9.3/backward"
242 // CHECK-GENTOO-4-9-X-32: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
243 // CHECK-GENTOO-4-9-X-32: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
244 // CHECK-GENTOO-4-9-X-32: "-internal-externc-isystem" "[[SYSROOT]]/include"
245 // CHECK-GENTOO-4-9-X-32: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
247 // Check header search on Debian 6 / MIPS64
248 // RUN: %clang -### %s -fsyntax-only 2>&1 \
249 // RUN: --target=mips64-unknown-linux-gnuabi64 -stdlib=libstdc++ \
250 // RUN: --sysroot=%S/Inputs/debian_6_mips64_tree \
251 // RUN: --gcc-toolchain="" \
252 // RUN: | FileCheck --check-prefix=CHECK-MIPS64-GNUABI %s
253 // CHECK-MIPS64-GNUABI: "-cc1"
254 // CHECK-MIPS64-GNUABI: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
255 // CHECK-MIPS64-GNUABI: "-isysroot" "[[SYSROOT:[^"]+]]"
256 // CHECK-MIPS64-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../../include/c++/4.9"
257 // CHECK-MIPS64-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../../include/c++/4.9/mips64-linux-gnuabi64"
258 // CHECK-MIPS64-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../../include/c++/4.9/backward"
259 // CHECK-MIPS64-GNUABI: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
260 // CHECK-MIPS64-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
261 // CHECK-MIPS64-GNUABI: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/mips64-linux-gnuabi64"
262 // CHECK-MIPS64-GNUABI: "-internal-externc-isystem" "[[SYSROOT]]/include"
263 // CHECK-MIPS64-GNUABI: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
265 // Check header search on Debian 6 / MIPS64
266 // RUN: %clang -### %s -fsyntax-only 2>&1 \
267 // RUN: --target=mips64el-unknown-linux-gnuabi64 -stdlib=libstdc++ \
268 // RUN: --sysroot=%S/Inputs/debian_6_mips64_tree \
269 // RUN: --gcc-toolchain="" \
270 // RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-GNUABI %s
271 // CHECK-MIPS64EL-GNUABI: "-cc1"
272 // CHECK-MIPS64EL-GNUABI: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
273 // CHECK-MIPS64EL-GNUABI: "-isysroot" "[[SYSROOT:[^"]+]]"
274 // CHECK-MIPS64EL-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../../include/c++/4.9"
275 // CHECK-MIPS64EL-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../../include/c++/4.9/mips64el-linux-gnuabi64"
276 // CHECK-MIPS64EL-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../../include/c++/4.9/backward"
277 // CHECK-MIPS64EL-GNUABI: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
278 // CHECK-MIPS64EL-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
279 // CHECK-MIPS64EL-GNUABI: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/mips64el-linux-gnuabi64"
280 // CHECK-MIPS64EL-GNUABI: "-internal-externc-isystem" "[[SYSROOT]]/include"
281 // CHECK-MIPS64EL-GNUABI: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
284 // Check header search on OpenEmbedded ARM.
285 // RUN: %clang -### %s -fsyntax-only 2>&1 \
286 // RUN: --target=arm-oe-linux-gnueabi -stdlib=libstdc++ \
287 // RUN: --sysroot=%S/Inputs/openembedded_arm_linux_tree \
288 // RUN: --gcc-toolchain="" \
289 // RUN: | FileCheck --check-prefix=CHECK-OE-ARM %s
291 // CHECK-OE-ARM: "-cc1"
292 // CHECK-OE-ARM: "-isysroot" "[[SYSROOT:[^"]+]]"
293 // CHECK-OE-ARM: "-internal-isystem" "[[SYSROOT]]/usr/lib/arm-oe-linux-gnueabi/6.3.0/../../../include/c++/6.3.0"
294 // CHECK-OE-ARM: "-internal-isystem" "[[SYSROOT]]/usr/lib/arm-oe-linux-gnueabi/6.3.0/../../../include/c++/6.3.0/backward"
296 // Check header search on OpenEmbedded AArch64.
297 // RUN: %clang -### %s -fsyntax-only 2>&1 \
298 // RUN: --target=aarch64-oe-linux -stdlib=libstdc++ \
299 // RUN: --sysroot=%S/Inputs/openembedded_aarch64_linux_tree \
300 // RUN: --gcc-toolchain="" \
301 // RUN: | FileCheck --check-prefix=CHECK-OE-AARCH64 %s
303 // CHECK-OE-AARCH64: "-cc1"
304 // CHECK-OE-AARCH64: "-isysroot" "[[SYSROOT:[^"]+]]"
305 // CHECK-OE-AARCH64: "-internal-isystem" "[[SYSROOT]]/usr/lib64/aarch64-oe-linux/6.3.0/../../../include/c++/6.3.0"
306 // CHECK-OE-AARCH64: "-internal-isystem" "[[SYSROOT]]/usr/lib64/aarch64-oe-linux/6.3.0/../../../include/c++/6.3.0/backward"
308 // Check header search with Cray's gcc package.
309 // RUN: %clang -### %s -fsyntax-only 2>&1 \
310 // RUN: --target=x86_64-unknown-linux-gnu -stdlib=libstdc++ \
311 // RUN: --sysroot=%S/Inputs/cray_suse_gcc_tree \
312 // RUN: --gcc-toolchain="%S/Inputs/cray_suse_gcc_tree/opt/gcc/8.2.0/snos" \
313 // RUN: | FileCheck --check-prefix=CHECK-CRAY-X86 %s
315 // CHECK-CRAY-X86: "-cc1"
316 // CHECK-CRAY-X86: "-isysroot" "[[SYSROOT:[^"]+]]"
317 // CHECK-CRAY-X86: "-internal-isystem" "[[SYSROOT]]/opt/gcc/8.2.0/snos/lib/gcc/x86_64-suse-linux/8.2.0/../../../../include/g++"
318 // CHECK-CRAY-X86: "-internal-isystem" "[[SYSROOT]]/opt/gcc/8.2.0/snos/lib/gcc/x86_64-suse-linux/8.2.0/../../../../include/g++/backward"