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: | FileCheck -check-prefixes=CHECK-INTERNAL-INCLUDE,CHECK-INTERNAL-INCLUDE-CXX %s
10 // RUN: %clangxx -### %s 2>&1 \
11 // RUN: --target=powerpc64-ibm-aix \
12 // RUN: -resource-dir=%S/Inputs/resource_dir \
13 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
14 // RUN: | FileCheck -check-prefixes=CHECK-INTERNAL-INCLUDE,CHECK-INTERNAL-INCLUDE-CXX %s
16 // RUN: %clang -### -xc %s 2>&1 \
17 // RUN: --target=powerpc-ibm-aix \
18 // RUN: -resource-dir=%S/Inputs/resource_dir \
19 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
20 // RUN: | FileCheck -check-prefix=CHECK-INTERNAL-INCLUDE %s
22 // RUN: %clang -### -xc %s 2>&1 \
23 // RUN: --target=powerpc64-ibm-aix \
24 // RUN: -resource-dir=%S/Inputs/resource_dir \
25 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
26 // RUN: | FileCheck -check-prefix=CHECK-INTERNAL-INCLUDE %s
28 // CHECK-INTERNAL-INCLUDE: "-cc1"
29 // CHECK-INTERNAL-INCLUDE: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
30 // CHECK-INTERNAL-INCLUDE: "-isysroot" "[[SYSROOT:[^"]+]]"
31 // CHECK-INTERNAL-INCLUDE-CXX: "-internal-isystem" "[[SYSROOT]]{{(/|\\\\)}}opt{{(/|\\\\)}}IBM{{(/|\\\\)}}openxlCSDK{{(/|\\\\)}}include{{(/|\\\\)}}c++{{(/|\\\\)}}v1"
32 // CHECK-INTERNAL-INCLUDE-CXX: "-D__LIBC_NO_CPP_MATH_OVERLOADS__"
33 // CHECK-INTERNAL-INCLUDE: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include"
34 // CHECK-INTERNAL-INCLUDE: "-internal-isystem" "[[SYSROOT]]/usr/include"
36 // Check powerpc-ibm-aix, 32-bit/64-bit. -nostdinc option.
37 // RUN: %clangxx -### %s 2>&1 \
38 // RUN: --target=powerpc-ibm-aix \
39 // RUN: -resource-dir=%S/Inputs/resource_dir \
40 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
42 // RUN: | FileCheck -check-prefix=CHECK-NOSTDINC-INCLUDE %s
44 // RUN: %clangxx -### %s 2>&1 \
45 // RUN: --target=powerpc64-ibm-aix \
46 // RUN: -resource-dir=%S/Inputs/resource_dir \
47 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
49 // RUN: | FileCheck -check-prefix=CHECK-NOSTDINC-INCLUDE %s
51 // RUN: %clang -### -xc %s 2>&1 \
52 // RUN: --target=powerpc-ibm-aix \
53 // RUN: -resource-dir=%S/Inputs/resource_dir \
54 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
56 // RUN: | FileCheck -check-prefix=CHECK-NOSTDINC-INCLUDE %s
58 // RUN: %clang -### -xc %s 2>&1 \
59 // RUN: --target=powerpc64-ibm-aix \
60 // RUN: -resource-dir=%S/Inputs/resource_dir \
61 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
63 // RUN: | FileCheck -check-prefix=CHECK-NOSTDINC-INCLUDE %s
65 // CHECK-NOSTDINC-INCLUDE: "-cc1"
66 // CHECK-NOSTDINC-INCLUDE: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
67 // CHECK-NOSTDINC-INCLUDE: "-isysroot" "[[SYSROOT:[^"]+]]"
68 // CHECK-NOSTDINC-INCLUDE-NOT: "-internal-isystem"
70 // Check powerpc-ibm-aix, 32-bit/64-bit. -nostdlibinc option.
71 // RUN: %clangxx -### %s 2>&1 \
72 // RUN: --target=powerpc-ibm-aix \
73 // RUN: -resource-dir=%S/Inputs/resource_dir \
74 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
75 // RUN: -nostdlibinc \
76 // RUN: | FileCheck -check-prefix=CHECK-NOSTDLIBINC-INCLUDE %s
78 // RUN: %clangxx -### %s 2>&1 \
79 // RUN: --target=powerpc64-ibm-aix \
80 // RUN: -resource-dir=%S/Inputs/resource_dir \
81 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
82 // RUN: -nostdlibinc \
83 // RUN: | FileCheck -check-prefix=CHECK-NOSTDLIBINC-INCLUDE %s
85 // RUN: %clang -### -xc %s 2>&1 \
86 // RUN: --target=powerpc-ibm-aix \
87 // RUN: -resource-dir=%S/Inputs/resource_dir \
88 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
89 // RUN: -nostdlibinc \
90 // RUN: | FileCheck -check-prefix=CHECK-NOSTDLIBINC-INCLUDE %s
92 // RUN: %clang -### -xc %s 2>&1 \
93 // RUN: --target=powerpc64-ibm-aix \
94 // RUN: -resource-dir=%S/Inputs/resource_dir \
95 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
96 // RUN: -nostdlibinc \
97 // RUN: | FileCheck -check-prefix=CHECK-NOSTDLIBINC-INCLUDE %s
99 // CHECK-NOSTDLIBINC-INCLUDE: "-cc1"
100 // CHECK-NOSTDLIBINC-INCLUDE: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
101 // CHECK-NOSTDLIBINC-INCLUDE: "-isysroot" "[[SYSROOT:[^"]+]]"
102 // CHECK-NOSTDLIBINC-INCLUDE: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include"
103 // CHECK-NOSTDLIBINC-INCLUDE-NOT: "-internal-isystem" "[[SYSROOT]]{{(/|\\\\)}}opt{{(/|\\\\)}}IBM{{(/|\\\\)}}openxlCSDK{{(/|\\\\)}}include{{(/|\\\\)}}c++{{(/|\\\\)}}v1"
104 // CHECK-NOSTDLIBINC-INCLUDE-NOT: "-D__LIBC_NO_CPP_MATH_OVERLOADS__"
105 // CHECK-NOSTDLIBINC-INCLUDE-NOT: "-internal-isystem" "[[SYSROOT]]/usr/include"
107 // Check powerpc-ibm-aix, 32-bit/64-bit. -nobuiltininc option.
108 // RUN: %clangxx -### %s 2>&1 \
109 // RUN: --target=powerpc-ibm-aix \
110 // RUN: -resource-dir=%S/Inputs/resource_dir \
111 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
112 // RUN: -nobuiltininc \
113 // RUN: | FileCheck -check-prefixes=CHECK-NOBUILTININC-INCLUDE,CHECK-NOBUILTININC-INCLUDE-CXX %s
115 // RUN: %clangxx -### %s 2>&1 \
116 // RUN: --target=powerpc64-ibm-aix \
117 // RUN: -resource-dir=%S/Inputs/resource_dir \
118 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
119 // RUN: -nobuiltininc \
120 // RUN: | FileCheck -check-prefixes=CHECK-NOBUILTININC-INCLUDE,CHECK-NOBUILTININC-INCLUDE-CXX %s
122 // RUN: %clang -### -xc %s 2>&1 \
123 // RUN: --target=powerpc-ibm-aix \
124 // RUN: -resource-dir=%S/Inputs/resource_dir \
125 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
126 // RUN: -nobuiltininc \
127 // RUN: | FileCheck -check-prefix=CHECK-NOBUILTININC-INCLUDE %s
129 // RUN: %clang -### -xc %s 2>&1 \
130 // RUN: --target=powerpc64-ibm-aix \
131 // RUN: -resource-dir=%S/Inputs/resource_dir \
132 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
133 // RUN: -nobuiltininc \
134 // RUN: | FileCheck -check-prefix=CHECK-NOBUILTININC-INCLUDE %s
136 // CHECK-NOBUILTININC-INCLUDE: "-cc1"
137 // CHECK-NOBUILTININC-INCLUDE: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
138 // CHECK-NOBUILTININC-INCLUDE: "-isysroot" "[[SYSROOT:[^"]+]]"
139 // CHECK-NOBUILTININC-INCLUDE-NOT: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include"
140 // CHECK-NOBUILTININC-INCLUDE-CXX: "-internal-isystem" "[[SYSROOT]]{{(/|\\\\)}}opt{{(/|\\\\)}}IBM{{(/|\\\\)}}openxlCSDK{{(/|\\\\)}}include{{(/|\\\\)}}c++{{(/|\\\\)}}v1"
141 // CHECK-NOBUILTININC-INCLUDE-CXX: "-D__LIBC_NO_CPP_MATH_OVERLOADS__"
142 // CHECK-NOBUILTININC-INCLUDE: "-internal-isystem" "[[SYSROOT]]/usr/include"
144 // Check powerpc-ibm-aix, 32-bit/64-bit. -nostdinc++ option.
145 // RUN: %clangxx -### %s 2>&1 \
146 // RUN: --target=powerpc-ibm-aix \
147 // RUN: -resource-dir=%S/Inputs/resource_dir \
148 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
149 // RUN: -nostdinc++ \
150 // RUN: | FileCheck -check-prefix=CHECK-NOSTDINCXX-INCLUDE %s
152 // RUN: %clangxx -### %s 2>&1 \
153 // RUN: --target=powerpc64-ibm-aix \
154 // RUN: -resource-dir=%S/Inputs/resource_dir \
155 // RUN: --sysroot=%S/Inputs/basic_aix_tree \
156 // RUN: -nostdinc++ \
157 // RUN: | FileCheck -check-prefix=CHECK-NOSTDINCXX-INCLUDE %s
159 // CHECK-NOSTDINCXX-INCLUDE: "-cc1"
160 // CHECK-NOSTDINCXX-INCLUDE: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
161 // CHECK-NOSTDINCXX-INCLUDE: "-isysroot" "[[SYSROOT:[^"]+]]"
162 // CHECK-NOSTDINCXX-INCLUDE: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include"
163 // CHECK-NOSTDINCXX-INCLUDE-NOT: "-internal-isystem" "[[SYSROOT]]{{(/|\\\\)}}opt{{(/|\\\\)}}IBM{{(/|\\\\)}}openxlCSDK{{(/|\\\\)}}include{{(/|\\\\)}}c++{{(/|\\\\)}}v1"
164 // CHECK-NOSTDINCXX-INCLUDE-NOT: "-D__LIBC_NO_CPP_MATH_OVERLOADS__"
165 // CHECK-NOSTDINCXX-INCLUDE: "-internal-isystem" "[[SYSROOT]]/usr/include"
167 // Check powerpc-ibm-aix, 32-bit. -stdlib=libstdc++ invokes fatal error.
168 // RUN: not --crash %clangxx %s 2>&1 -### \
169 // RUN: --target=powerpc-ibm-aix \
170 // RUN: -stdlib=libstdc++ \
171 // RUN: --sysroot %S/Inputs/aix_ppc_tree \
172 // RUN: | FileCheck --check-prefix=CHECK-INCLUDE-LIBSTDCXX %s
174 // Check powerpc64-ibm-aix, 64-bit. -stdlib=libstdc++ invokes fatal error.
175 // RUN: not --crash %clangxx %s 2>&1 -### \
176 // RUN: --target=powerpc64-ibm-aix \
177 // RUN: -stdlib=libstdc++ \
178 // RUN: --sysroot %S/Inputs/aix_ppc_tree \
179 // RUN: | FileCheck --check-prefix=CHECK-INCLUDE-LIBSTDCXX %s
181 // CHECK-INCLUDE-LIBSTDCXX: LLVM ERROR: picking up libstdc++ headers is unimplemented on AIX