[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Driver / aix-toolchain-include.cpp
blobb0074bf0ba1fdbf36fac67713aa13895526fbdfc
1 // Tests that the AIX toolchain adds system includes to its search path.
3 // Check powerpc-ibm-aix, 32-bit/64-bit.
4 // RUN: %clangxx -### %s 2>&1 \
5 // RUN: --target=powerpc-ibm-aix \
6 // RUN: -resource-dir=%S/Inputs/resource_dir \
7 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
8 // RUN: -fopenmp=libomp \
9 // RUN: | FileCheck -check-prefixes=CHECK-INTERNAL-INCLUDE,CHECK-INTERNAL-INCLUDE-CXX %s
11 // RUN: %clangxx -### %s 2>&1 \
12 // RUN: --target=powerpc64-ibm-aix \
13 // RUN: -resource-dir=%S/Inputs/resource_dir \
14 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
15 // RUN: -fopenmp=libomp \
16 // RUN: | FileCheck -check-prefixes=CHECK-INTERNAL-INCLUDE,CHECK-INTERNAL-INCLUDE-CXX %s
18 // RUN: %clang -### -xc %s 2>&1 \
19 // RUN: --target=powerpc-ibm-aix \
20 // RUN: -resource-dir=%S/Inputs/resource_dir \
21 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
22 // RUN: -fopenmp=libomp \
23 // RUN: | FileCheck -check-prefix=CHECK-INTERNAL-INCLUDE %s
25 // RUN: %clang -### -xc %s 2>&1 \
26 // RUN: --target=powerpc64-ibm-aix \
27 // RUN: -resource-dir=%S/Inputs/resource_dir \
28 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
29 // RUN: -fopenmp=libomp \
30 // RUN: | FileCheck -check-prefix=CHECK-INTERNAL-INCLUDE %s
32 // CHECK-INTERNAL-INCLUDE: "-cc1"
33 // CHECK-INTERNAL-INCLUDE: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
34 // CHECK-INTERNAL-INCLUDE: "-isysroot" "[[SYSROOT:[^"]+]]"
35 // CHECK-INTERNAL-INCLUDE-CXX: "-internal-isystem" "[[SYSROOT]]{{(/|\\\\)}}opt{{(/|\\\\)}}IBM{{(/|\\\\)}}openxlCSDK{{(/|\\\\)}}include{{(/|\\\\)}}c++{{(/|\\\\)}}v1"
36 // CHECK-INTERNAL-INCLUDE-CXX: "-D__LIBC_NO_CPP_MATH_OVERLOADS__"
37 // CHECK-INTERNAL-INCLUDE: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include"
38 // CHECK-INTERNAL-INCLUDE: "-internal-isystem" "[[SYSROOT]]{{(/|\\\\)}}opt{{(/|\\\\)}}IBM{{(/|\\\\)}}openxlCSDK{{(/|\\\\)}}include{{(/|\\\\)}}openmp"
39 // CHECK-INTERNAL-INCLUDE: "-internal-isystem" "[[SYSROOT]]/usr/include"
41 // Check powerpc-ibm-aix, 32-bit/64-bit. -nostdinc option.
42 // RUN: %clangxx -### %s 2>&1 \
43 // RUN: --target=powerpc-ibm-aix \
44 // RUN: -resource-dir=%S/Inputs/resource_dir \
45 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
46 // RUN: -nostdinc \
47 // RUN: | FileCheck -check-prefix=CHECK-NOSTDINC-INCLUDE %s
49 // RUN: %clangxx -### %s 2>&1 \
50 // RUN: --target=powerpc64-ibm-aix \
51 // RUN: -resource-dir=%S/Inputs/resource_dir \
52 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
53 // RUN: -nostdinc \
54 // RUN: | FileCheck -check-prefix=CHECK-NOSTDINC-INCLUDE %s
56 // RUN: %clang -### -xc %s 2>&1 \
57 // RUN: --target=powerpc-ibm-aix \
58 // RUN: -resource-dir=%S/Inputs/resource_dir \
59 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
60 // RUN: -nostdinc \
61 // RUN: | FileCheck -check-prefix=CHECK-NOSTDINC-INCLUDE %s
63 // RUN: %clang -### -xc %s 2>&1 \
64 // RUN: --target=powerpc64-ibm-aix \
65 // RUN: -resource-dir=%S/Inputs/resource_dir \
66 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
67 // RUN: -nostdinc \
68 // RUN: | FileCheck -check-prefix=CHECK-NOSTDINC-INCLUDE %s
70 // CHECK-NOSTDINC-INCLUDE: "-cc1"
71 // CHECK-NOSTDINC-INCLUDE: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
72 // CHECK-NOSTDINC-INCLUDE: "-isysroot" "[[SYSROOT:[^"]+]]"
73 // CHECK-NOSTDINC-INCLUDE-NOT: "-internal-isystem"
75 // Check powerpc-ibm-aix, 32-bit/64-bit. -nostdlibinc option.
76 // RUN: %clangxx -### %s 2>&1 \
77 // RUN: --target=powerpc-ibm-aix \
78 // RUN: -resource-dir=%S/Inputs/resource_dir \
79 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
80 // RUN: -nostdlibinc \
81 // RUN: -fopenmp=libomp \
82 // RUN: | FileCheck -check-prefix=CHECK-NOSTDLIBINC-INCLUDE %s
84 // RUN: %clangxx -### %s 2>&1 \
85 // RUN: --target=powerpc64-ibm-aix \
86 // RUN: -resource-dir=%S/Inputs/resource_dir \
87 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
88 // RUN: -nostdlibinc \
89 // RUN: -fopenmp=libomp \
90 // RUN: | FileCheck -check-prefix=CHECK-NOSTDLIBINC-INCLUDE %s
92 // RUN: %clang -### -xc %s 2>&1 \
93 // RUN: --target=powerpc-ibm-aix \
94 // RUN: -resource-dir=%S/Inputs/resource_dir \
95 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
96 // RUN: -nostdlibinc \
97 // RUN: -fopenmp=libomp \
98 // RUN: | FileCheck -check-prefix=CHECK-NOSTDLIBINC-INCLUDE %s
100 // RUN: %clang -### -xc %s 2>&1 \
101 // RUN: --target=powerpc64-ibm-aix \
102 // RUN: -resource-dir=%S/Inputs/resource_dir \
103 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
104 // RUN: -nostdlibinc \
105 // RUN: -fopenmp=libomp \
106 // RUN: | FileCheck -check-prefix=CHECK-NOSTDLIBINC-INCLUDE %s
108 // CHECK-NOSTDLIBINC-INCLUDE: "-cc1"
109 // CHECK-NOSTDLIBINC-INCLUDE: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
110 // CHECK-NOSTDLIBINC-INCLUDE: "-isysroot" "[[SYSROOT:[^"]+]]"
111 // CHECK-NOSTDLIBINC-INCLUDE: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include"
112 // CHECK-NOSTDLIBINC-INCLUDE: "-internal-isystem" "[[SYSROOT]]{{(/|\\\\)}}opt{{(/|\\\\)}}IBM{{(/|\\\\)}}openxlCSDK{{(/|\\\\)}}include{{(/|\\\\)}}openmp"
113 // CHECK-NOSTDLIBINC-INCLUDE-NOT: "-internal-isystem" "[[SYSROOT]]{{(/|\\\\)}}opt{{(/|\\\\)}}IBM{{(/|\\\\)}}openxlCSDK{{(/|\\\\)}}include{{(/|\\\\)}}c++{{(/|\\\\)}}v1"
114 // CHECK-NOSTDLIBINC-INCLUDE-NOT: "-D__LIBC_NO_CPP_MATH_OVERLOADS__"
115 // CHECK-NOSTDLIBINC-INCLUDE-NOT: "-internal-isystem" "[[SYSROOT]]/usr/include"
117 // Check powerpc-ibm-aix, 32-bit/64-bit. -nobuiltininc option.
118 // RUN: %clangxx -### %s 2>&1 \
119 // RUN: --target=powerpc-ibm-aix \
120 // RUN: -resource-dir=%S/Inputs/resource_dir \
121 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
122 // RUN: -nobuiltininc \
123 // RUN: -fopenmp=libomp \
124 // RUN: | FileCheck -check-prefixes=CHECK-NOBUILTININC-INCLUDE,CHECK-NOBUILTININC-INCLUDE-CXX %s
126 // RUN: %clangxx -### %s 2>&1 \
127 // RUN: --target=powerpc64-ibm-aix \
128 // RUN: -resource-dir=%S/Inputs/resource_dir \
129 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
130 // RUN: -nobuiltininc \
131 // RUN: -fopenmp=libomp \
132 // RUN: | FileCheck -check-prefixes=CHECK-NOBUILTININC-INCLUDE,CHECK-NOBUILTININC-INCLUDE-CXX %s
134 // RUN: %clang -### -xc %s 2>&1 \
135 // RUN: --target=powerpc-ibm-aix \
136 // RUN: -resource-dir=%S/Inputs/resource_dir \
137 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
138 // RUN: -nobuiltininc \
139 // RUN: -fopenmp=libomp \
140 // RUN: | FileCheck -check-prefix=CHECK-NOBUILTININC-INCLUDE %s
142 // RUN: %clang -### -xc %s 2>&1 \
143 // RUN: --target=powerpc64-ibm-aix \
144 // RUN: -resource-dir=%S/Inputs/resource_dir \
145 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
146 // RUN: -nobuiltininc \
147 // RUN: -fopenmp=libomp \
148 // RUN: | FileCheck -check-prefix=CHECK-NOBUILTININC-INCLUDE %s
150 // CHECK-NOBUILTININC-INCLUDE: "-cc1"
151 // CHECK-NOBUILTININC-INCLUDE: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
152 // CHECK-NOBUILTININC-INCLUDE: "-isysroot" "[[SYSROOT:[^"]+]]"
153 // CHECK-NOBUILTININC-INCLUDE-NOT: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include"
154 // CHECK-NOBUILTININC-INCLUDE-CXX: "-internal-isystem" "[[SYSROOT]]{{(/|\\\\)}}opt{{(/|\\\\)}}IBM{{(/|\\\\)}}openxlCSDK{{(/|\\\\)}}include{{(/|\\\\)}}c++{{(/|\\\\)}}v1"
155 // CHECK-NOBUILTININC-INCLUDE-CXX: "-D__LIBC_NO_CPP_MATH_OVERLOADS__"
156 // CHECK-NOBUILTININC-INCLUDE: "-internal-isystem" "[[SYSROOT]]{{(/|\\\\)}}opt{{(/|\\\\)}}IBM{{(/|\\\\)}}openxlCSDK{{(/|\\\\)}}include{{(/|\\\\)}}openmp"
157 // CHECK-NOBUILTININC-INCLUDE: "-internal-isystem" "[[SYSROOT]]/usr/include"
159 // Check powerpc-ibm-aix, 32-bit/64-bit. -nostdinc++ option.
160 // RUN: %clangxx -### %s 2>&1 \
161 // RUN: --target=powerpc-ibm-aix \
162 // RUN: -resource-dir=%S/Inputs/resource_dir \
163 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
164 // RUN: -nostdinc++ \
165 // RUN: -fopenmp=libomp \
166 // RUN: | FileCheck -check-prefix=CHECK-NOSTDINCXX-INCLUDE %s
168 // RUN: %clangxx -### %s 2>&1 \
169 // RUN: --target=powerpc64-ibm-aix \
170 // RUN: -resource-dir=%S/Inputs/resource_dir \
171 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
172 // RUN: -nostdinc++ \
173 // RUN: -fopenmp=libomp \
174 // RUN: | FileCheck -check-prefix=CHECK-NOSTDINCXX-INCLUDE %s
176 // CHECK-NOSTDINCXX-INCLUDE: "-cc1"
177 // CHECK-NOSTDINCXX-INCLUDE: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
178 // CHECK-NOSTDINCXX-INCLUDE: "-isysroot" "[[SYSROOT:[^"]+]]"
179 // CHECK-NOSTDINCXX-INCLUDE: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include"
180 // CHECK-NOSTDINCXX-INCLUDE-NOT: "-internal-isystem" "[[SYSROOT]]{{(/|\\\\)}}opt{{(/|\\\\)}}IBM{{(/|\\\\)}}openxlCSDK{{(/|\\\\)}}include{{(/|\\\\)}}c++{{(/|\\\\)}}v1"
181 // CHECK-NOSTDINCXX-INCLUDE-NOT: "-D__LIBC_NO_CPP_MATH_OVERLOADS__"
182 // CHECK-NOSTDINCXX-INCLUDE: "-internal-isystem" "[[SYSROOT]]{{(/|\\\\)}}opt{{(/|\\\\)}}IBM{{(/|\\\\)}}openxlCSDK{{(/|\\\\)}}include{{(/|\\\\)}}openmp"
183 // CHECK-NOSTDINCXX-INCLUDE: "-internal-isystem" "[[SYSROOT]]/usr/include"
185 // Check powerpc-ibm-aix, 32-bit. -stdlib=libstdc++ invokes fatal error.
186 // RUN: not --crash %clangxx %s 2>&1 -### \
187 // RUN: --target=powerpc-ibm-aix \
188 // RUN: -stdlib=libstdc++ \
189 // RUN: --sysroot %S/Inputs/aix_ppc_tree \
190 // RUN: | FileCheck --check-prefix=CHECK-INCLUDE-LIBSTDCXX %s
192 // Check powerpc64-ibm-aix, 64-bit. -stdlib=libstdc++ invokes fatal error.
193 // RUN: not --crash %clangxx %s 2>&1 -### \
194 // RUN: --target=powerpc64-ibm-aix \
195 // RUN: -stdlib=libstdc++ \
196 // RUN: --sysroot %S/Inputs/aix_ppc_tree \
197 // RUN: | FileCheck --check-prefix=CHECK-INCLUDE-LIBSTDCXX %s
199 // CHECK-INCLUDE-LIBSTDCXX: LLVM ERROR: picking up libstdc++ headers is unimplemented on AIX