1 // UNSUPPORTED: system-windows
3 // RUN: %clang -### %s --target=i686-pc-hurd-gnu --sysroot=%S/Inputs/basic_hurd_tree \
4 // RUN: --stdlib=platform 2>&1 | FileCheck --check-prefix=CHECK %s
6 // CHECK-SAME: "-isysroot" "[[SYSROOT:[^"]+]]"
7 // CHECK-SAME: {{^}} "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-gnu/10/../../../../include/c++/10"
8 /// Debian specific - the path component after 'include' is i386-gnu even
9 /// though the installation is i686-gnu.
10 // CHECK-SAME: {{^}} "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-gnu/10/../../../../include/i386-gnu/c++/10"
11 // CHECK-SAME: {{^}} "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-gnu/10/../../../../include/c++/10/backward"
12 // CHECK-SAME: {{^}} "-internal-isystem" "[[SYSROOT]]/usr/local/include"
13 // CHECK-SAME: "-internal-externc-isystem"
14 // CHECK-SAME: {{^}} "[[SYSROOT]]/usr/include/i386-gnu"
15 // CHECK-SAME: {{^}} "-internal-externc-isystem" "[[SYSROOT]]/include"
16 // CHECK-SAME: {{^}} "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
17 // CHECK: "{{.*}}ld" "--sysroot=[[SYSROOT:[^"]+]]"
18 // CHECK-SAME: "-dynamic-linker" "/lib/ld.so"
19 // CHECK-SAME: "{{.*}}/usr/lib/gcc/i686-gnu/10/crtbegin.o"
21 // CHECK-SAME: {{^}}[[SYSROOT]]/usr/lib/gcc/i686-gnu/10"
22 // CHECK-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/gcc/i686-gnu/10/../../../../lib32"
23 // CHECK-SAME: {{^}} "-L[[SYSROOT]]/lib/i386-gnu"
24 // CHECK-SAME: {{^}} "-L[[SYSROOT]]/lib/../lib32"
25 // CHECK-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/i386-gnu"
26 // CHECK-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/../lib32"
27 // CHECK-SAME: {{^}} "-L[[SYSROOT]]/lib"
28 // CHECK-SAME: {{^}} "-L[[SYSROOT]]/usr/lib"
30 // RUN: %clang -### %s --target=i686-pc-hurd-gnu --sysroot=%S/Inputs/basic_hurd_tree \
31 // RUN: --stdlib=platform -static 2>&1 | FileCheck --check-prefix=CHECK-STATIC %s
32 // CHECK-STATIC: "-cc1"
33 // CHECK-STATIC-SAME: "-static-define"
34 // CHECK-STATIC-SAME: "-isysroot" "[[SYSROOT:[^"]+]]"
35 // CHECK-STATIC-SAME: {{^}} "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-gnu/10/../../../../include/c++/10"
36 /// Debian specific - the path component after 'include' is i386-gnu even
37 /// though the installation is i686-gnu.
38 // CHECK-STATIC-SAME: {{^}} "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-gnu/10/../../../../include/i386-gnu/c++/10"
39 // CHECK-STATIC-SAME: {{^}} "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/i686-gnu/10/../../../../include/c++/10/backward"
40 // CHECK-STATIC-SAME: {{^}} "-internal-isystem" "[[SYSROOT]]/usr/local/include"
41 // CHECK-STATIC-SAME: "-internal-externc-isystem"
42 // CHECK-STATIC-SAME: {{^}} "[[SYSROOT]]/usr/include/i386-gnu"
43 // CHECK-STATIC-SAME: {{^}} "-internal-externc-isystem" "[[SYSROOT]]/include"
44 // CHECK-STATIC-SAME: {{^}} "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
45 // CHECK-STATIC: "{{.*}}ld" "--sysroot=[[SYSROOT:[^"]+]]"
46 // CHECK-STATIC-SAME: "-static"
47 // CHECK-STATIC-SAME: "{{.*}}/usr/lib/gcc/i686-gnu/10/crtbeginT.o"
48 // CHECK-STATIC-SAME: "-L
49 // CHECK-STATIC-SAME: {{^}}[[SYSROOT]]/usr/lib/gcc/i686-gnu/10"
50 // CHECK-STATIC-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/gcc/i686-gnu/10/../../../../lib32"
51 // CHECK-STATIC-SAME: {{^}} "-L[[SYSROOT]]/lib/i386-gnu"
52 // CHECK-STATIC-SAME: {{^}} "-L[[SYSROOT]]/lib/../lib32"
53 // CHECK-STATIC-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/i386-gnu"
54 // CHECK-STATIC-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/../lib32"
55 // CHECK-STATIC-SAME: {{^}} "-L[[SYSROOT]]/lib"
56 // CHECK-STATIC-SAME: {{^}} "-L[[SYSROOT]]/usr/lib"
58 // RUN: %clang -### %s --target=i686-pc-hurd-gnu --sysroot=%S/Inputs/basic_hurd_tree \
59 // RUN: -shared 2>&1 | FileCheck --check-prefix=CHECK-SHARED %s
60 // CHECK-SHARED: "{{.*}}ld" "--sysroot=[[SYSROOT:[^"]+]]"
61 // CHECK-SHARED-SAME: "{{.*}}/usr/lib/gcc/i686-gnu/10/crtbeginS.o"
62 // CHECK-SHARED-SAME: "-L
63 // CHECK-SHARED-SAME: {{^}}[[SYSROOT]]/usr/lib/gcc/i686-gnu/10"
64 // CHECK-SHARED-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/gcc/i686-gnu/10/../../../../lib32"
65 // CHECK-SHARED-SAME: {{^}} "-L[[SYSROOT]]/lib/i386-gnu"
66 // CHECK-SHARED-SAME: {{^}} "-L[[SYSROOT]]/lib/../lib32"
67 // CHECK-SHARED-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/i386-gnu"
68 // CHECK-SHARED-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/../lib32"
69 // CHECK-SHARED-SAME: {{^}} "-L[[SYSROOT]]/lib"
70 // CHECK-SHARED-SAME: {{^}} "-L[[SYSROOT]]/usr/lib"
72 // RUN: %clang -### -o %t %s 2>&1 -no-integrated-as -fuse-ld=ld \
73 // RUN: --gcc-toolchain=%S/Inputs/basic_cross_hurd_tree/usr \
74 // RUN: --target=i686-pc-gnu \
75 // RUN: | FileCheck --check-prefix=CHECK-CROSS %s
76 // CHECK-CROSS: "-cc1" "-triple" "i686-pc-hurd-gnu"
77 // CHECK-CROSS: "{{.*}}/Inputs/basic_cross_hurd_tree/usr/lib/gcc/i686-gnu/10/../../../../i686-gnu/bin/as" "--32"
78 // CHECK-CROSS: "{{.*}}/Inputs/basic_cross_hurd_tree/usr/lib/gcc/i686-gnu/10/../../../../i686-gnu/bin/ld" {{.*}} "-m" "elf_i386"
79 // CHECK-CROSS: "{{.*}}/Inputs/basic_cross_hurd_tree/usr/lib/gcc/i686-gnu/10/crtbegin.o"
80 // CHECK-CROSS: "-L{{.*}}/Inputs/basic_cross_hurd_tree/usr/lib/gcc/i686-gnu/10/../../../../i686-gnu/lib"
82 // RUN: %clang -### %s --target=x86_64-pc-hurd-gnu --sysroot=%S/Inputs/basic_hurd_tree \
83 // RUN: --stdlib=platform 2>&1 | FileCheck --check-prefix=CHECK-64 %s
85 // CHECK-64-SAME: "-isysroot" "[[SYSROOT:[^"]+]]"
86 // CHECK-64-SAME: {{^}} "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-gnu/10/../../../../include/c++/10"
87 /// Debian specific - the path component after 'include' is x86_64-gnu even
88 /// though the installation is x86_64-gnu.
89 // CHECK-64-SAME: {{^}} "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-gnu/10/../../../../include/x86_64-gnu/c++/10"
90 // CHECK-64-SAME: {{^}} "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-gnu/10/../../../../include/c++/10/backward"
91 // CHECK-64-SAME: {{^}} "-internal-isystem" "[[SYSROOT]]/usr/local/include"
92 // CHECK-64-SAME: "-internal-externc-isystem"
93 // CHECK-64-SAME: {{^}} "[[SYSROOT]]/usr/include/x86_64-gnu"
94 // CHECK-64-SAME: {{^}} "-internal-externc-isystem" "[[SYSROOT]]/include"
95 // CHECK-64-SAME: {{^}} "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
96 // CHECK-64: "{{.*}}ld" "--sysroot=[[SYSROOT:[^"]+]]"
97 // CHECK-64-SAME: "-dynamic-linker" "/lib/ld-x86-64.so.1"
98 // CHECK-64-SAME: "{{.*}}/usr/lib/gcc/x86_64-gnu/10/crtbegin.o"
100 // CHECK-64-SAME: {{^}}[[SYSROOT]]/usr/lib/gcc/x86_64-gnu/10"
101 // CHECK-64-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/gcc/x86_64-gnu/10/../../../../lib64"
102 // CHECK-64-SAME: {{^}} "-L[[SYSROOT]]/lib/x86_64-gnu"
103 // CHECK-64-SAME: {{^}} "-L[[SYSROOT]]/lib/../lib64"
104 // CHECK-64-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/x86_64-gnu"
105 // CHECK-64-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/../lib64"
106 // CHECK-64-SAME: {{^}} "-L[[SYSROOT]]/lib"
107 // CHECK-64-SAME: {{^}} "-L[[SYSROOT]]/usr/lib"
109 // RUN: %clang -### %s --target=x86_64-pc-hurd-gnu --sysroot=%S/Inputs/basic_hurd_tree \
110 // RUN: --stdlib=platform -static 2>&1 | FileCheck --check-prefix=CHECK-64-STATIC %s
111 // CHECK-64-STATIC: "-cc1"
112 // CHECK-64-STATIC-SAME: "-static-define"
113 // CHECK-64-STATIC-SAME: "-isysroot" "[[SYSROOT:[^"]+]]"
114 // CHECK-64-STATIC-SAME: {{^}} "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-gnu/10/../../../../include/c++/10"
115 /// Debian specific - the path component after 'include' is x86_64-gnu even
116 /// though the installation is x86_64-gnu.
117 // CHECK-64-STATIC-SAME: {{^}} "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-gnu/10/../../../../include/x86_64-gnu/c++/10"
118 // CHECK-64-STATIC-SAME: {{^}} "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-gnu/10/../../../../include/c++/10/backward"
119 // CHECK-64-STATIC-SAME: {{^}} "-internal-isystem" "[[SYSROOT]]/usr/local/include"
120 // CHECK-64-STATIC-SAME: "-internal-externc-isystem"
121 // CHECK-64-STATIC-SAME: {{^}} "[[SYSROOT]]/usr/include/x86_64-gnu"
122 // CHECK-64-STATIC-SAME: {{^}} "-internal-externc-isystem" "[[SYSROOT]]/include"
123 // CHECK-64-STATIC-SAME: {{^}} "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
124 // CHECK-64-STATIC: "{{.*}}ld" "--sysroot=[[SYSROOT:[^"]+]]"
125 // CHECK-64-STATIC-SAME: "-static"
126 // CHECK-64-STATIC-SAME: "{{.*}}/usr/lib/gcc/x86_64-gnu/10/crtbeginT.o"
127 // CHECK-64-STATIC-SAME: "-L
128 // CHECK-64-STATIC-SAME: {{^}}[[SYSROOT]]/usr/lib/gcc/x86_64-gnu/10"
129 // CHECK-64-STATIC-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/gcc/x86_64-gnu/10/../../../../lib64"
130 // CHECK-64-STATIC-SAME: {{^}} "-L[[SYSROOT]]/lib/x86_64-gnu"
131 // CHECK-64-STATIC-SAME: {{^}} "-L[[SYSROOT]]/lib/../lib64"
132 // CHECK-64-STATIC-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/x86_64-gnu"
133 // CHECK-64-STATIC-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/../lib64"
134 // CHECK-64-STATIC-SAME: {{^}} "-L[[SYSROOT]]/lib"
135 // CHECK-64-STATIC-SAME: {{^}} "-L[[SYSROOT]]/usr/lib"
137 // RUN: %clang -### %s --target=x86_64-pc-hurd-gnu --sysroot=%S/Inputs/basic_hurd_tree \
138 // RUN: -shared 2>&1 | FileCheck --check-prefix=CHECK-64-SHARED %s
139 // CHECK-64-SHARED: "{{.*}}ld" "--sysroot=[[SYSROOT:[^"]+]]"
140 // CHECK-64-SHARED-SAME: "{{.*}}/usr/lib/gcc/x86_64-gnu/10/crtbeginS.o"
141 // CHECK-64-SHARED-SAME: "-L
142 // CHECK-64-SHARED-SAME: {{^}}[[SYSROOT]]/usr/lib/gcc/x86_64-gnu/10"
143 // CHECK-64-SHARED-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/gcc/x86_64-gnu/10/../../../../lib64"
144 // CHECK-64-SHARED-SAME: {{^}} "-L[[SYSROOT]]/lib/x86_64-gnu"
145 // CHECK-64-SHARED-SAME: {{^}} "-L[[SYSROOT]]/lib/../lib64"
146 // CHECK-64-SHARED-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/x86_64-gnu"
147 // CHECK-64-SHARED-SAME: {{^}} "-L[[SYSROOT]]/usr/lib/../lib64"
148 // CHECK-64-SHARED-SAME: {{^}} "-L[[SYSROOT]]/lib"
149 // CHECK-64-SHARED-SAME: {{^}} "-L[[SYSROOT]]/usr/lib"
151 // RUN: %clang -### -o %t %s 2>&1 -no-integrated-as -fuse-ld=ld \
152 // RUN: --gcc-toolchain=%S/Inputs/basic_cross_hurd_tree/usr \
153 // RUN: --target=x86_64-pc-gnu \
154 // RUN: | FileCheck --check-prefix=CHECK-64-CROSS %s
155 // CHECK-64-CROSS: "-cc1" "-triple" "x86_64-pc-hurd-gnu"
156 // CHECK-64-CROSS: "{{.*}}/Inputs/basic_cross_hurd_tree/usr/lib/gcc/x86_64-gnu/10/../../../../x86_64-gnu/bin/as" "--64"
157 // CHECK-64-CROSS: "{{.*}}/Inputs/basic_cross_hurd_tree/usr/lib/gcc/x86_64-gnu/10/../../../../x86_64-gnu/bin/ld" {{.*}} "-m" "elf_x86_64"
158 // CHECK-64-CROSS: "{{.*}}/Inputs/basic_cross_hurd_tree/usr/lib/gcc/x86_64-gnu/10/crtbegin.o"
159 // CHECK-64-CROSS: "-L{{.*}}/Inputs/basic_cross_hurd_tree/usr/lib/gcc/x86_64-gnu/10/../../../../x86_64-gnu/lib"