Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Driver / linux-header-search.cpp
blobdd4d6eb483a3fb777f487bcb5128eea5b2d297cc
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]][[SEP:/|\\\\]]usr[[SEP]]include[[SEP]]x86_64-unknown-linux-gnu[[SEP]]c++[[SEP]]v1"
17 // CHECK-BASIC-LIBCXX-SYSROOT: "-internal-isystem" "[[SYSROOT]][[SEP]]usr[[SEP]]include[[SEP]]c++[[SEP]]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[[SEP:/|\\\\]]include[[SEP]]x86_64-unknown-linux-gnu[[SEP]]c++[[SEP]]v1"
32 // CHECK-BASIC-LIBCXX-SYSROOT-SLASH-SAME: "-internal-isystem" "[[SYSROOT]]usr[[SEP]]include[[SEP]]c++[[SEP]]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[[SEP:/|\\\\]]..[[SEP]]include[[SEP]]x86_64-unknown-linux-gnu[[SEP]]c++[[SEP]]v1"
46 // CHECK-BASIC-LIBCXX-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/bin[[SEP]]..[[SEP]]include[[SEP]]c++[[SEP]]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]][[SEP:/|\\\\]]usr[[SEP]]include[[SEP]]x86_64-unknown-linux-gnu[[SEP]]c++[[SEP]]v2"
60 // CHECK-BASIC-LIBCXXV2-SYSROOT: "-internal-isystem" "[[SYSROOT]][[SEP]]usr[[SEP]]include[[SEP]]c++[[SEP]]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[[SEP:/|\\\\]]..[[SEP]]include[[SEP]]x86_64-unknown-linux-gnu[[SEP]]c++[[SEP]]v2"
73 // CHECK-BASIC-LIBCXXV2-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/bin[[SEP]]..[[SEP]]include[[SEP]]c++[[SEP]]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]][[SEP:/|\\\\]]usr[[SEP]]include[[SEP]]x86_64-unknown-linux-gnu[[SEP]]c++[[SEP]]v2"
101 // CHECK-BASIC-LIBSTDCXX-LIBCXXV2-SYSROOT: "-internal-isystem" "[[SYSROOT]][[SEP]]usr[[SEP]]include[[SEP]]c++[[SEP]]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 loong64
248 // RUN: %clang -### %s -fsyntax-only 2>&1 \
249 // RUN: --target=loongarch64-unknown-linux-gnu -stdlib=libstdc++ \
250 // RUN: --sysroot=%S/Inputs/debian_loong64_tree \
251 // RUN: --gcc-toolchain="" \
252 // RUN: | FileCheck --check-prefix=CHECK-LOONG64-GNU %s
254 // Check that "-gnuf64" is seen as "-gnu" for loong64.
255 // RUN: %clang -### %s -fsyntax-only 2>&1 \
256 // RUN: --target=loongarch64-unknown-linux-gnuf64 -stdlib=libstdc++ \
257 // RUN: --sysroot=%S/Inputs/debian_loong64_tree \
258 // RUN: --gcc-toolchain="" \
259 // RUN: | FileCheck --check-prefix=CHECK-LOONG64-GNU %s
260 // CHECK-LOONG64-GNU: "-cc1"
261 // CHECK-LOONG64-GNU: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
262 // CHECK-LOONG64-GNU: "-isysroot" "[[SYSROOT:[^"]+]]"
263 // CHECK-LOONG64-GNU: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/loongarch64-linux-gnu/13/../../../../include/c++/13"
264 // CHECK-LOONG64-GNU: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/loongarch64-linux-gnu/13/../../../../include/c++/13/loongarch64-linux-gnu"
265 // CHECK-LOONG64-GNU: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/loongarch64-linux-gnu/13/../../../../include/c++/13/backward"
266 // CHECK-LOONG64-GNU: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
267 // CHECK-LOONG64-GNU: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
268 // CHECK-LOONG64-GNU: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/loongarch64-linux-gnu/13/../../../../loongarch64-linux-gnu/include"
269 // CHECK-LOONG64-GNU: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/loongarch64-linux-gnu"
270 // CHECK-LOONG64-GNU: "-internal-externc-isystem" "[[SYSROOT]]/include"
271 // CHECK-LOONG64-GNU: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
273 // Check header search on Debian 6 / MIPS64
274 // RUN: %clang -### %s -fsyntax-only 2>&1 \
275 // RUN: --target=mips64-unknown-linux-gnuabi64 -stdlib=libstdc++ \
276 // RUN: --sysroot=%S/Inputs/debian_6_mips64_tree \
277 // RUN: --gcc-toolchain="" \
278 // RUN: | FileCheck --check-prefix=CHECK-MIPS64-GNUABI %s
279 // CHECK-MIPS64-GNUABI: "-cc1"
280 // CHECK-MIPS64-GNUABI: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
281 // CHECK-MIPS64-GNUABI: "-isysroot" "[[SYSROOT:[^"]+]]"
282 // CHECK-MIPS64-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../../include/c++/4.9"
283 // CHECK-MIPS64-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../../include/c++/4.9/mips64-linux-gnuabi64"
284 // CHECK-MIPS64-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../../include/c++/4.9/backward"
285 // CHECK-MIPS64-GNUABI: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
286 // CHECK-MIPS64-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
287 // CHECK-MIPS64-GNUABI: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/mips64-linux-gnuabi64"
288 // CHECK-MIPS64-GNUABI: "-internal-externc-isystem" "[[SYSROOT]]/include"
289 // CHECK-MIPS64-GNUABI: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
291 // Check header search on Debian 6 / MIPS64
292 // RUN: %clang -### %s -fsyntax-only 2>&1 \
293 // RUN: --target=mips64el-unknown-linux-gnuabi64 -stdlib=libstdc++ \
294 // RUN: --sysroot=%S/Inputs/debian_6_mips64_tree \
295 // RUN: --gcc-toolchain="" \
296 // RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-GNUABI %s
297 // CHECK-MIPS64EL-GNUABI: "-cc1"
298 // CHECK-MIPS64EL-GNUABI: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
299 // CHECK-MIPS64EL-GNUABI: "-isysroot" "[[SYSROOT:[^"]+]]"
300 // CHECK-MIPS64EL-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../../include/c++/4.9"
301 // CHECK-MIPS64EL-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../../include/c++/4.9/mips64el-linux-gnuabi64"
302 // CHECK-MIPS64EL-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../../include/c++/4.9/backward"
303 // CHECK-MIPS64EL-GNUABI: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
304 // CHECK-MIPS64EL-GNUABI: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
305 // CHECK-MIPS64EL-GNUABI: "-internal-externc-isystem" "[[SYSROOT]]/usr/include/mips64el-linux-gnuabi64"
306 // CHECK-MIPS64EL-GNUABI: "-internal-externc-isystem" "[[SYSROOT]]/include"
307 // CHECK-MIPS64EL-GNUABI: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
310 // Check header search on OpenEmbedded ARM.
311 // RUN: %clang -### %s -fsyntax-only 2>&1 \
312 // RUN: --target=arm-oe-linux-gnueabi -stdlib=libstdc++ \
313 // RUN: --sysroot=%S/Inputs/openembedded_arm_linux_tree \
314 // RUN: --gcc-toolchain="" \
315 // RUN: | FileCheck --check-prefix=CHECK-OE-ARM %s
317 // CHECK-OE-ARM: "-cc1"
318 // CHECK-OE-ARM: "-isysroot" "[[SYSROOT:[^"]+]]"
319 // CHECK-OE-ARM: "-internal-isystem" "[[SYSROOT]]/usr/lib/arm-oe-linux-gnueabi/6.3.0/../../../include/c++/6.3.0"
320 // CHECK-OE-ARM: "-internal-isystem" "[[SYSROOT]]/usr/lib/arm-oe-linux-gnueabi/6.3.0/../../../include/c++/6.3.0/backward"
322 // Check header search on OpenEmbedded AArch64.
323 // RUN: %clang -### %s -fsyntax-only 2>&1 \
324 // RUN: --target=aarch64-oe-linux -stdlib=libstdc++ \
325 // RUN: --sysroot=%S/Inputs/openembedded_aarch64_linux_tree \
326 // RUN: --gcc-toolchain="" \
327 // RUN: | FileCheck --check-prefix=CHECK-OE-AARCH64 %s
329 // CHECK-OE-AARCH64: "-cc1"
330 // CHECK-OE-AARCH64: "-isysroot" "[[SYSROOT:[^"]+]]"
331 // CHECK-OE-AARCH64: "-internal-isystem" "[[SYSROOT]]/usr/lib64/aarch64-oe-linux/6.3.0/../../../include/c++/6.3.0"
332 // CHECK-OE-AARCH64: "-internal-isystem" "[[SYSROOT]]/usr/lib64/aarch64-oe-linux/6.3.0/../../../include/c++/6.3.0/backward"
334 // Check header search with Cray's gcc package.
335 // RUN: %clang -### %s -fsyntax-only 2>&1 \
336 // RUN: --target=x86_64-unknown-linux-gnu -stdlib=libstdc++ \
337 // RUN: --sysroot=%S/Inputs/cray_suse_gcc_tree \
338 // RUN: --gcc-toolchain="%S/Inputs/cray_suse_gcc_tree/opt/gcc/8.2.0/snos" \
339 // RUN: | FileCheck --check-prefix=CHECK-CRAY-X86 %s
341 // CHECK-CRAY-X86: "-cc1"
342 // CHECK-CRAY-X86: "-isysroot" "[[SYSROOT:[^"]+]]"
343 // CHECK-CRAY-X86: "-internal-isystem" "[[SYSROOT]]/opt/gcc/8.2.0/snos/lib/gcc/x86_64-suse-linux/8.2.0/../../../../include/g++"
344 // CHECK-CRAY-X86: "-internal-isystem" "[[SYSROOT]]/opt/gcc/8.2.0/snos/lib/gcc/x86_64-suse-linux/8.2.0/../../../../include/g++/backward"