1 // Tests that the z/OS toolchain adds system includes to its search path.
3 // RUN: %clangxx -c -### %s --target=s390x-ibm-zos 2>&1 \
6 // CHECK: "-D_UNIX03_WITHDRAWN"
7 // CHECK-SAME: "-D_OPEN_DEFAULT"
8 // CHECK-SAME: "-D_XOPEN_SOURCE=600"
9 // CHECK-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
10 // CHECK-SAME: "-internal-isystem" "{{.*}}{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"
11 // CHECK-SAME: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include{{(/|\\\\)}}zos_wrappers"
12 // CHECK-SAME: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include"
13 // CHECK-SAME: "-internal-isystem" "/usr/include"
14 // CHECK-SAME: "-fshort-enums"
15 // CHECK-SAME: "-fno-signed-char"
16 // CHECK-SAME: "-fno-signed-wchar"
18 // RUN: %clangxx -c -### -mzos-sys-include=/ABC/DEF %s 2>&1 \
19 // RUN: --target=s390x-ibm-zos \
20 // RUN: | FileCheck --check-prefixes=CHECK2 %s
22 // CHECK2: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
23 // CHECK2-SAME: "-internal-isystem" "{{.*}}{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"
24 // CHECK2-SAME: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include{{(/|\\\\)}}zos_wrappers"
25 // CHECK2-SAME: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include"
26 // CHECK2-SAME: "-internal-isystem" "{{/|\\\\}}ABC{{/|\\\\}}DEF"
27 // CHECK2-NOT: "-internal-isystem" "/usr/include"
28 // CHECK2-SAME: "-fshort-enums"
29 // CHECK2-SAME: "-fno-signed-char"
30 // CHECK2-SAME: "-fno-signed-wchar"
32 // RUN: %clangxx -c -### -nostdinc %s 2>&1 \
33 // RUN: --target=s390x-ibm-zos \
34 // RUN: | FileCheck --check-prefixes=CHECK3 %s
36 // CHECK3: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
37 // CHECK3-NOT: "-internal-isystem" "{{.*}}/bin/../include/c++/v1"
38 // CHECK3-NOT: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include{{(/|\\\\)}}zos_wrappers"
39 // CHECK3-NOT: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include"
40 // CHECK3-NOT: "-internal-isystem" "/usr/include"
41 // CHECK3-SAME: "-fshort-enums"
42 // CHECK3-SAME: "-fno-signed-char"
43 // CHECK3-SAME: "-fno-signed-wchar"
45 // RUN: %clangxx -c -### -nostdinc++ %s 2>&1 \
46 // RUN: --target=s390x-ibm-zos \
47 // RUN: | FileCheck --check-prefixes=CHECK4 %s
49 // CHECK4: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
50 // CHECK4-NOT: "-internal-isystem" "{{.*}}{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"
51 // CHECK4-SAME: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include{{(/|\\\\)}}zos_wrappers"
52 // CHECK4-SAME: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include"
53 // CHECK4-SAME: "-internal-isystem" "/usr/include"
54 // CHECK4-SAME: "-fshort-enums"
55 // CHECK4-SAME: "-fno-signed-char"
56 // CHECK4-SAME: "-fno-signed-wchar"
58 // RUN: %clangxx -c -### -nostdlibinc %s 2>&1 \
59 // RUN: --target=s390x-ibm-zos \
60 // RUN: | FileCheck --check-prefixes=CHECK5 %s
62 // CHECK5: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
63 // CHECK5-NOT: "-internal-isystem" "{{.*}}{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"
64 // CHECK5-SAME: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include{{(/|\\\\)}}zos_wrappers"
65 // CHECK5-SAME: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include"
66 // CHECK5-SAME: "-internal-isystem" "/usr/include"
67 // CHECK5-SAME: "-fshort-enums"
68 // CHECK5-SAME: "-fno-signed-char"
69 // CHECK5-SAME: "-fno-signed-wchar"
71 // RUN: %clangxx -c -### -nobuiltininc %s 2>&1 \
72 // RUN: --target=s390x-ibm-zos \
73 // RUN: | FileCheck --check-prefixes=CHECK6 %s
75 // CHECK6: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
76 // CHECK6-SAME: "-internal-isystem" "{{.*}}{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"
77 // CHECK6-NOT: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include{{(/|\\\\)}}zos_wrappers"
78 // CHECK6-NOT: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include"
79 // CHECK6-SAME: "-internal-isystem" "/usr/include"
80 // CHECK6-SAME: "-fshort-enums"
81 // CHECK6-SAME: "-fno-signed-char"
82 // CHECK6-SAME: "-fno-signed-wchar"
84 // RUN: %clangxx -c -### -D_XOPEN_SOURCE=700 %s 2>&1 \
85 // RUN: --target=s390x-ibm-zos \
86 // RUN: | FileCheck --check-prefixes=CHECK7 %s
88 // CHECK7: "-D_UNIX03_WITHDRAWN"
89 // CHECK7-SAME: "-D_OPEN_DEFAULT"
90 // CHECK7-NOT: "-D_XOPEN_SOURCE=600"
91 // CHECK7-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
92 // CHECK7-SAME: "-D" "_XOPEN_SOURCE=700"
93 // CHECK7-SAME: "-internal-isystem" "{{.*}}{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"
94 // CHECK7-SAME: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include{{(/|\\\\)}}zos_wrappers"
95 // CHECK7-SAME: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include"
96 // CHECK7-SAME: "-internal-isystem" "/usr/include"
97 // CHECK7-SAME: "-fshort-enums"
98 // CHECK7-SAME: "-fno-signed-char"
99 // CHECK7-SAME: "-fno-signed-wchar"