xref: /minix3/external/bsd/llvm/dist/clang/test/Driver/linux-ld.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc // General tests that ld invocations on Linux targets sane. Note that we use
2f4a2713aSLionel Sambuc // sysroot to make these tests independent of the host system.
3f4a2713aSLionel Sambuc //
4f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
5f4a2713aSLionel Sambuc // RUN:     --target=i386-unknown-linux \
6*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
7f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
8f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-LD-32 %s
9f4a2713aSLionel Sambuc // CHECK-LD-32-NOT: warning:
10f4a2713aSLionel Sambuc // CHECK-LD-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
11f4a2713aSLionel Sambuc // CHECK-LD-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
12f4a2713aSLionel Sambuc // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0"
13f4a2713aSLionel Sambuc // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib"
14f4a2713aSLionel Sambuc // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.."
15f4a2713aSLionel Sambuc // CHECK-LD-32: "-L[[SYSROOT]]/lib"
16f4a2713aSLionel Sambuc // CHECK-LD-32: "-L[[SYSROOT]]/usr/lib"
17f4a2713aSLionel Sambuc //
18f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
19f4a2713aSLionel Sambuc // RUN:     --target=x86_64-unknown-linux \
20*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
21f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
22f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-LD-64 %s
23f4a2713aSLionel Sambuc // CHECK-LD-64-NOT: warning:
24f4a2713aSLionel Sambuc // CHECK-LD-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
25f4a2713aSLionel Sambuc // CHECK-LD-64: "--eh-frame-hdr"
26f4a2713aSLionel Sambuc // CHECK-LD-64: "-m" "elf_x86_64"
27f4a2713aSLionel Sambuc // CHECK-LD-64: "-dynamic-linker"
28f4a2713aSLionel Sambuc // CHECK-LD-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
29f4a2713aSLionel Sambuc // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
30f4a2713aSLionel Sambuc // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
31f4a2713aSLionel Sambuc // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
32f4a2713aSLionel Sambuc // CHECK-LD-64: "-L[[SYSROOT]]/lib"
33f4a2713aSLionel Sambuc // CHECK-LD-64: "-L[[SYSROOT]]/usr/lib"
34f4a2713aSLionel Sambuc // CHECK-LD-64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
35f4a2713aSLionel Sambuc // CHECK-LD-64: "-lc"
36f4a2713aSLionel Sambuc // CHECK-LD-64: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
37f4a2713aSLionel Sambuc //
38f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
39*0a6a1f1dSLionel Sambuc // RUN:     --target=x86_64-unknown-linux-gnux32 \
40*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
41*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
42*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-LD-X32 %s
43*0a6a1f1dSLionel Sambuc // CHECK-LD-X32-NOT: warning:
44*0a6a1f1dSLionel Sambuc // CHECK-LD-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
45*0a6a1f1dSLionel Sambuc // CHECK-LD-X32: "--eh-frame-hdr"
46*0a6a1f1dSLionel Sambuc // CHECK-LD-X32: "-m" "elf32_x86_64"
47*0a6a1f1dSLionel Sambuc // CHECK-LD-X32: "-dynamic-linker"
48*0a6a1f1dSLionel Sambuc // CHECK-LD-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
49*0a6a1f1dSLionel Sambuc // CHECK-LD-X32: "-lc"
50*0a6a1f1dSLionel Sambuc // CHECK-LD-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
51*0a6a1f1dSLionel Sambuc //
52*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
53*0a6a1f1dSLionel Sambuc // RUN:     --target=x86_64-unknown-linux \
54*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
55*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
56*0a6a1f1dSLionel Sambuc // RUN:     --rtlib=compiler-rt \
57*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-LD-RT %s
58*0a6a1f1dSLionel Sambuc // CHECK-LD-RT-NOT: warning:
59*0a6a1f1dSLionel Sambuc // CHECK-LD-RT: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
60*0a6a1f1dSLionel Sambuc // CHECK-LD-RT: "--eh-frame-hdr"
61*0a6a1f1dSLionel Sambuc // CHECK-LD-RT: "-m" "elf_x86_64"
62*0a6a1f1dSLionel Sambuc // CHECK-LD-RT: "-dynamic-linker"
63*0a6a1f1dSLionel Sambuc // CHECK-LD-RT: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
64*0a6a1f1dSLionel Sambuc // CHECK-LD-RT: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
65*0a6a1f1dSLionel Sambuc // CHECK-LD-RT: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
66*0a6a1f1dSLionel Sambuc // CHECK-LD-RT: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
67*0a6a1f1dSLionel Sambuc // CHECK-LD-RT: "-L[[SYSROOT]]/lib"
68*0a6a1f1dSLionel Sambuc // CHECK-LD-RT: "-L[[SYSROOT]]/usr/lib"
69*0a6a1f1dSLionel Sambuc // CHECK-LD-RT: libclang_rt.builtins-x86_64.a" "-lgcc_s"
70*0a6a1f1dSLionel Sambuc // CHECK-LD-RT: "-lc"
71*0a6a1f1dSLionel Sambuc // CHECK-LD-RT: libclang_rt.builtins-x86_64.a" "-lgcc_s"
72*0a6a1f1dSLionel Sambuc //
73*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
74*0a6a1f1dSLionel Sambuc // RUN:     --target=x86_64-unknown-linux \
75*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
76*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
77*0a6a1f1dSLionel Sambuc // RUN:     --rtlib=libgcc \
78*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-LD-GCC %s
79*0a6a1f1dSLionel Sambuc // CHECK-LD-GCC-NOT: warning:
80*0a6a1f1dSLionel Sambuc // CHECK-LD-GCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
81*0a6a1f1dSLionel Sambuc // CHECK-LD-GCC: "--eh-frame-hdr"
82*0a6a1f1dSLionel Sambuc // CHECK-LD-GCC: "-m" "elf_x86_64"
83*0a6a1f1dSLionel Sambuc // CHECK-LD-GCC: "-dynamic-linker"
84*0a6a1f1dSLionel Sambuc // CHECK-LD-GCC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
85*0a6a1f1dSLionel Sambuc // CHECK-LD-GCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
86*0a6a1f1dSLionel Sambuc // CHECK-LD-GCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
87*0a6a1f1dSLionel Sambuc // CHECK-LD-GCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
88*0a6a1f1dSLionel Sambuc // CHECK-LD-GCC: "-L[[SYSROOT]]/lib"
89*0a6a1f1dSLionel Sambuc // CHECK-LD-GCC: "-L[[SYSROOT]]/usr/lib"
90*0a6a1f1dSLionel Sambuc // CHECK-LD-GCC "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
91*0a6a1f1dSLionel Sambuc // CHECK-LD-GCC: "-lc"
92*0a6a1f1dSLionel Sambuc // CHECK-LD-GCC: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
93*0a6a1f1dSLionel Sambuc //
94*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
95f4a2713aSLionel Sambuc // RUN:     --target=x86_64-unknown-linux \
96f4a2713aSLionel Sambuc // RUN:     -static-libgcc \
97*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
98f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
99f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-LD-64-STATIC-LIBGCC %s
100f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC-LIBGCC-NOT: warning:
101f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC-LIBGCC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
102f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC-LIBGCC: "--eh-frame-hdr"
103f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC-LIBGCC: "-m" "elf_x86_64"
104f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC-LIBGCC: "-dynamic-linker"
105f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC-LIBGCC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
106f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
107f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
108f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
109f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/lib"
110f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC-LIBGCC: "-L[[SYSROOT]]/usr/lib"
111f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC-LIBGCC: "-lgcc" "-lgcc_eh"
112f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC-LIBGCC: "-lc"
113f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC-LIBGCC: "-lgcc" "-lgcc_eh"
114f4a2713aSLionel Sambuc //
115f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
116f4a2713aSLionel Sambuc // RUN:     --target=x86_64-unknown-linux \
117f4a2713aSLionel Sambuc // RUN:     -static \
118*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
119f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
120f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-LD-64-STATIC %s
121f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC-NOT: warning:
122f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
123f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC-NOT: "--eh-frame-hdr"
124f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC: "-m" "elf_x86_64"
125f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC-NOT: "-dynamic-linker"
126f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC: "-static"
127f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbeginT.o"
128f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
129f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
130f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
131f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/lib"
132f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC: "-L[[SYSROOT]]/usr/lib"
133f4a2713aSLionel Sambuc // CHECK-LD-64-STATIC: "--start-group" "-lgcc" "-lgcc_eh" "-lc" "--end-group"
134f4a2713aSLionel Sambuc //
135f4a2713aSLionel Sambuc // Check that flags can be combined. The -static dominates.
136f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
137f4a2713aSLionel Sambuc // RUN:     --target=x86_64-unknown-linux \
138f4a2713aSLionel Sambuc // RUN:     -static-libgcc -static \
139*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
140f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
141f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-LD-64-STATIC %s
142f4a2713aSLionel Sambuc //
143f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
144f4a2713aSLionel Sambuc // RUN:     --target=i386-unknown-linux -m32 \
145*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
146f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/multilib_32bit_linux_tree \
147f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-32-TO-32 %s
148f4a2713aSLionel Sambuc // CHECK-32-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
149f4a2713aSLionel Sambuc // CHECK-32-TO-32: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
150f4a2713aSLionel Sambuc // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0"
151f4a2713aSLionel Sambuc // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib/../lib32"
152f4a2713aSLionel Sambuc // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../lib32"
153f4a2713aSLionel Sambuc // CHECK-32-TO-32: "-L[[SYSROOT]]/lib/../lib32"
154f4a2713aSLionel Sambuc // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/../lib32"
155f4a2713aSLionel Sambuc // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib"
156f4a2713aSLionel Sambuc // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.."
157f4a2713aSLionel Sambuc // CHECK-32-TO-32: "-L[[SYSROOT]]/lib"
158f4a2713aSLionel Sambuc // CHECK-32-TO-32: "-L[[SYSROOT]]/usr/lib"
159f4a2713aSLionel Sambuc //
160f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
161f4a2713aSLionel Sambuc // RUN:     --target=i386-unknown-linux -m64 \
162*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
163f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/multilib_32bit_linux_tree \
164f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-32-TO-64 %s
165f4a2713aSLionel Sambuc // CHECK-32-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
166f4a2713aSLionel Sambuc // CHECK-32-TO-64: "{{.*}}/usr/lib/gcc/i386-unknown-linux/4.6.0/64{{/|\\\\}}crtbegin.o"
167f4a2713aSLionel Sambuc // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/64"
168f4a2713aSLionel Sambuc // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib/../lib64"
169f4a2713aSLionel Sambuc // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../lib64"
170f4a2713aSLionel Sambuc // CHECK-32-TO-64: "-L[[SYSROOT]]/lib/../lib64"
171f4a2713aSLionel Sambuc // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/../lib64"
172f4a2713aSLionel Sambuc // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0"
173f4a2713aSLionel Sambuc // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../../../i386-unknown-linux/lib"
174f4a2713aSLionel Sambuc // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/i386-unknown-linux/4.6.0/../../.."
175f4a2713aSLionel Sambuc // CHECK-32-TO-64: "-L[[SYSROOT]]/lib"
176f4a2713aSLionel Sambuc // CHECK-32-TO-64: "-L[[SYSROOT]]/usr/lib"
177f4a2713aSLionel Sambuc //
178f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
179f4a2713aSLionel Sambuc // RUN:     --target=x86_64-unknown-linux -m64 \
180*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
181f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/multilib_64bit_linux_tree \
182f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-64-TO-64 %s
183f4a2713aSLionel Sambuc // CHECK-64-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
184f4a2713aSLionel Sambuc // CHECK-64-TO-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
185f4a2713aSLionel Sambuc // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
186f4a2713aSLionel Sambuc // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../lib64"
187f4a2713aSLionel Sambuc // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../lib64"
188f4a2713aSLionel Sambuc // CHECK-64-TO-64: "-L[[SYSROOT]]/lib/../lib64"
189f4a2713aSLionel Sambuc // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/../lib64"
190f4a2713aSLionel Sambuc // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
191f4a2713aSLionel Sambuc // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
192f4a2713aSLionel Sambuc // CHECK-64-TO-64: "-L[[SYSROOT]]/lib"
193f4a2713aSLionel Sambuc // CHECK-64-TO-64: "-L[[SYSROOT]]/usr/lib"
194f4a2713aSLionel Sambuc //
195f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
196f4a2713aSLionel Sambuc // RUN:     --target=x86_64-unknown-linux -m32 \
197*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
198f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/multilib_64bit_linux_tree \
199f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-64-TO-32 %s
200f4a2713aSLionel Sambuc // CHECK-64-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
201f4a2713aSLionel Sambuc // CHECK-64-TO-32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32{{/|\\\\}}crtbegin.o"
202f4a2713aSLionel Sambuc // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32"
203f4a2713aSLionel Sambuc // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../lib32"
204f4a2713aSLionel Sambuc // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../lib32"
205f4a2713aSLionel Sambuc // CHECK-64-TO-32: "-L[[SYSROOT]]/lib/../lib32"
206f4a2713aSLionel Sambuc // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/../lib32"
207f4a2713aSLionel Sambuc // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
208f4a2713aSLionel Sambuc // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
209f4a2713aSLionel Sambuc // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
210f4a2713aSLionel Sambuc // CHECK-64-TO-32: "-L[[SYSROOT]]/lib"
211f4a2713aSLionel Sambuc // CHECK-64-TO-32: "-L[[SYSROOT]]/usr/lib"
212f4a2713aSLionel Sambuc //
213f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
214*0a6a1f1dSLionel Sambuc // RUN:     --target=x86_64-unknown-linux-gnux32 \
215*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
216*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/multilib_64bit_linux_tree \
217*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-X32 %s
218*0a6a1f1dSLionel Sambuc // CHECK-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
219*0a6a1f1dSLionel Sambuc // CHECK-X32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/x32{{/|\\\\}}crtbegin.o"
220*0a6a1f1dSLionel Sambuc // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/x32"
221*0a6a1f1dSLionel Sambuc // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../libx32"
222*0a6a1f1dSLionel Sambuc // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../libx32"
223*0a6a1f1dSLionel Sambuc // CHECK-X32: "-L[[SYSROOT]]/lib/../libx32"
224*0a6a1f1dSLionel Sambuc // CHECK-X32: "-L[[SYSROOT]]/usr/lib/../libx32"
225*0a6a1f1dSLionel Sambuc // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
226*0a6a1f1dSLionel Sambuc // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
227*0a6a1f1dSLionel Sambuc // CHECK-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
228*0a6a1f1dSLionel Sambuc // CHECK-X32: "-L[[SYSROOT]]/lib"
229*0a6a1f1dSLionel Sambuc // CHECK-X32: "-L[[SYSROOT]]/usr/lib"
230*0a6a1f1dSLionel Sambuc //
231*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
232*0a6a1f1dSLionel Sambuc // RUN:     --target=x86_64-unknown-linux -mx32 \
233*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
234*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/multilib_64bit_linux_tree \
235*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-64-TO-X32 %s
236*0a6a1f1dSLionel Sambuc // CHECK-64-TO-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
237*0a6a1f1dSLionel Sambuc // CHECK-64-TO-X32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/x32{{/|\\\\}}crtbegin.o"
238*0a6a1f1dSLionel Sambuc // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/x32"
239*0a6a1f1dSLionel Sambuc // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../libx32"
240*0a6a1f1dSLionel Sambuc // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../libx32"
241*0a6a1f1dSLionel Sambuc // CHECK-64-TO-X32: "-L[[SYSROOT]]/lib/../libx32"
242*0a6a1f1dSLionel Sambuc // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib/../libx32"
243*0a6a1f1dSLionel Sambuc // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
244*0a6a1f1dSLionel Sambuc // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
245*0a6a1f1dSLionel Sambuc // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
246*0a6a1f1dSLionel Sambuc // CHECK-64-TO-X32: "-L[[SYSROOT]]/lib"
247*0a6a1f1dSLionel Sambuc // CHECK-64-TO-X32: "-L[[SYSROOT]]/usr/lib"
248*0a6a1f1dSLionel Sambuc //
249*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
250*0a6a1f1dSLionel Sambuc // RUN:     --target=i386-unknown-linux -mx32 \
251*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
252*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/multilib_64bit_linux_tree \
253*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-32-TO-X32 %s
254*0a6a1f1dSLionel Sambuc // CHECK-32-TO-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
255*0a6a1f1dSLionel Sambuc // CHECK-32-TO-X32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/x32{{/|\\\\}}crtbegin.o"
256*0a6a1f1dSLionel Sambuc // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/x32"
257*0a6a1f1dSLionel Sambuc // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../libx32"
258*0a6a1f1dSLionel Sambuc // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../libx32"
259*0a6a1f1dSLionel Sambuc // CHECK-32-TO-X32: "-L[[SYSROOT]]/lib/../libx32"
260*0a6a1f1dSLionel Sambuc // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib/../libx32"
261*0a6a1f1dSLionel Sambuc // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
262*0a6a1f1dSLionel Sambuc // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
263*0a6a1f1dSLionel Sambuc // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
264*0a6a1f1dSLionel Sambuc // CHECK-32-TO-X32: "-L[[SYSROOT]]/lib"
265*0a6a1f1dSLionel Sambuc // CHECK-32-TO-X32: "-L[[SYSROOT]]/usr/lib"
266*0a6a1f1dSLionel Sambuc //
267*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
268*0a6a1f1dSLionel Sambuc // RUN:     --target=x86_64-unknown-linux-gnux32 -m64 \
269*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
270*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/multilib_64bit_linux_tree \
271*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-X32-TO-64 %s
272*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
273*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
274*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
275*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../lib64"
276*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../lib64"
277*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-64: "-L[[SYSROOT]]/lib/../lib64"
278*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/../lib64"
279*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
280*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
281*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-64: "-L[[SYSROOT]]/lib"
282*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-64: "-L[[SYSROOT]]/usr/lib"
283*0a6a1f1dSLionel Sambuc //
284*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
285*0a6a1f1dSLionel Sambuc // RUN:     --target=x86_64-unknown-linux-gnux32 -m32 \
286*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
287*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/multilib_64bit_linux_tree \
288*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-X32-TO-32 %s
289*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
290*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-32: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32{{/|\\\\}}crtbegin.o"
291*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32"
292*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib/../lib32"
293*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../lib32"
294*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-32: "-L[[SYSROOT]]/lib/../lib32"
295*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/../lib32"
296*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
297*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../../../x86_64-unknown-linux/lib"
298*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0/../../.."
299*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-32: "-L[[SYSROOT]]/lib"
300*0a6a1f1dSLionel Sambuc // CHECK-X32-TO-32: "-L[[SYSROOT]]/usr/lib"
301*0a6a1f1dSLionel Sambuc //
302*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
303f4a2713aSLionel Sambuc // RUN:     --target=x86_64-unknown-linux -m32 \
304f4a2713aSLionel Sambuc // RUN:     --gcc-toolchain=%S/Inputs/multilib_64bit_linux_tree/usr \
305f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/multilib_32bit_linux_tree \
306f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-64-TO-32-SYSROOT %s
307f4a2713aSLionel Sambuc // CHECK-64-TO-32-SYSROOT: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
308f4a2713aSLionel Sambuc // CHECK-64-TO-32-SYSROOT: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32{{/|\\\\}}crtbegin.o"
309f4a2713aSLionel Sambuc // CHECK-64-TO-32-SYSROOT: "-L{{[^"]*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0/32"
310f4a2713aSLionel Sambuc // CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/lib/../lib32"
311f4a2713aSLionel Sambuc // CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/usr/lib/../lib32"
312f4a2713aSLionel Sambuc // CHECK-64-TO-32-SYSROOT: "-L{{[^"]*}}/Inputs/multilib_64bit_linux_tree/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
313f4a2713aSLionel Sambuc // CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/lib"
314f4a2713aSLionel Sambuc // CHECK-64-TO-32-SYSROOT: "-L[[SYSROOT]]/usr/lib"
315f4a2713aSLionel Sambuc //
316f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
317f4a2713aSLionel Sambuc // RUN:     --target=i386-unknown-linux -m32 \
318f4a2713aSLionel Sambuc // RUN:     -ccc-install-dir %S/Inputs/fake_install_tree/bin \
319*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
320f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
321f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-INSTALL-DIR-32 %s
322f4a2713aSLionel Sambuc // CHECK-INSTALL-DIR-32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
323f4a2713aSLionel Sambuc // CHECK-INSTALL-DIR-32: "{{.*}}/Inputs/fake_install_tree/bin/../lib/gcc/i386-unknown-linux/4.7.0{{/|\\\\}}crtbegin.o"
324f4a2713aSLionel Sambuc // CHECK-INSTALL-DIR-32: "-L{{.*}}/Inputs/fake_install_tree/bin/../lib/gcc/i386-unknown-linux/4.7.0"
325f4a2713aSLionel Sambuc //
326f4a2713aSLionel Sambuc // Check that with 64-bit builds, we don't actually use the install directory
327f4a2713aSLionel Sambuc // as its version of GCC is lower than our sysrooted version.
328f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
329f4a2713aSLionel Sambuc // RUN:     --target=x86_64-unknown-linux -m64 \
330f4a2713aSLionel Sambuc // RUN:     -ccc-install-dir %S/Inputs/fake_install_tree/bin \
331*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
332f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
333f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-INSTALL-DIR-64 %s
334f4a2713aSLionel Sambuc // CHECK-INSTALL-DIR-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
335f4a2713aSLionel Sambuc // CHECK-INSTALL-DIR-64: "{{.*}}/usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
336f4a2713aSLionel Sambuc // CHECK-INSTALL-DIR-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-unknown-linux/4.6.0"
337f4a2713aSLionel Sambuc //
338f4a2713aSLionel Sambuc // Check that we support unusual patch version formats, including missing that
339f4a2713aSLionel Sambuc // component.
340f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
341f4a2713aSLionel Sambuc // RUN:     --target=i386-unknown-linux -m32 \
342f4a2713aSLionel Sambuc // RUN:     -ccc-install-dir %S/Inputs/gcc_version_parsing1/bin \
343*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
344f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
345f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-GCC-VERSION1 %s
346f4a2713aSLionel Sambuc // CHECK-GCC-VERSION1: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
347f4a2713aSLionel Sambuc // CHECK-GCC-VERSION1: "{{.*}}/Inputs/gcc_version_parsing1/bin/../lib/gcc/i386-unknown-linux/4.7{{/|\\\\}}crtbegin.o"
348f4a2713aSLionel Sambuc // CHECK-GCC-VERSION1: "-L{{.*}}/Inputs/gcc_version_parsing1/bin/../lib/gcc/i386-unknown-linux/4.7"
349f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
350f4a2713aSLionel Sambuc // RUN:     --target=i386-unknown-linux -m32 \
351f4a2713aSLionel Sambuc // RUN:     -ccc-install-dir %S/Inputs/gcc_version_parsing2/bin \
352*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
353f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
354f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-GCC-VERSION2 %s
355f4a2713aSLionel Sambuc // CHECK-GCC-VERSION2: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
356f4a2713aSLionel Sambuc // CHECK-GCC-VERSION2: "{{.*}}/Inputs/gcc_version_parsing2/bin/../lib/gcc/i386-unknown-linux/4.7.x{{/|\\\\}}crtbegin.o"
357f4a2713aSLionel Sambuc // CHECK-GCC-VERSION2: "-L{{.*}}/Inputs/gcc_version_parsing2/bin/../lib/gcc/i386-unknown-linux/4.7.x"
358f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
359f4a2713aSLionel Sambuc // RUN:     --target=i386-unknown-linux -m32 \
360f4a2713aSLionel Sambuc // RUN:     -ccc-install-dir %S/Inputs/gcc_version_parsing3/bin \
361*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
362f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
363f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-GCC-VERSION3 %s
364f4a2713aSLionel Sambuc // CHECK-GCC-VERSION3: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
365f4a2713aSLionel Sambuc // CHECK-GCC-VERSION3: "{{.*}}/Inputs/gcc_version_parsing3/bin/../lib/gcc/i386-unknown-linux/4.7.99-rc5{{/|\\\\}}crtbegin.o"
366f4a2713aSLionel Sambuc // CHECK-GCC-VERSION3: "-L{{.*}}/Inputs/gcc_version_parsing3/bin/../lib/gcc/i386-unknown-linux/4.7.99-rc5"
367f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
368f4a2713aSLionel Sambuc // RUN:     --target=i386-unknown-linux -m32 \
369f4a2713aSLionel Sambuc // RUN:     -ccc-install-dir %S/Inputs/gcc_version_parsing4/bin \
370*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
371f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
372f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-GCC-VERSION4 %s
373f4a2713aSLionel Sambuc // CHECK-GCC-VERSION4: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
374f4a2713aSLionel Sambuc // CHECK-GCC-VERSION4: "{{.*}}/Inputs/gcc_version_parsing4/bin/../lib/gcc/i386-unknown-linux/4.7.99{{/|\\\\}}crtbegin.o"
375f4a2713aSLionel Sambuc // CHECK-GCC-VERSION4: "-L{{.*}}/Inputs/gcc_version_parsing4/bin/../lib/gcc/i386-unknown-linux/4.7.99"
376f4a2713aSLionel Sambuc //
377*0a6a1f1dSLionel Sambuc // Test a simulated installation of libc++ on Linux, both through sysroot and
378*0a6a1f1dSLionel Sambuc // the installation path of Clang.
379*0a6a1f1dSLionel Sambuc // RUN: %clangxx -no-canonical-prefixes -x c++ %s -### -o %t.o 2>&1 \
380*0a6a1f1dSLionel Sambuc // RUN:     -target x86_64-unknown-linux-gnu \
381*0a6a1f1dSLionel Sambuc // RUN:     -stdlib=libc++ \
382*0a6a1f1dSLionel Sambuc // RUN:     -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \
383*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
384*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_libcxx_tree \
385*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-SYSROOT %s
386*0a6a1f1dSLionel Sambuc // CHECK-BASIC-LIBCXX-SYSROOT: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
387*0a6a1f1dSLionel Sambuc // CHECK-BASIC-LIBCXX-SYSROOT: "-isysroot" "[[SYSROOT:[^"]+]]"
388*0a6a1f1dSLionel Sambuc // CHECK-BASIC-LIBCXX-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v1"
389*0a6a1f1dSLionel Sambuc // CHECK-BASIC-LIBCXX-SYSROOT: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
390*0a6a1f1dSLionel Sambuc // CHECK-BASIC-LIBCXX-SYSROOT: "--sysroot=[[SYSROOT]]"
391*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes -x c++ %s -### -o %t.o 2>&1 \
392*0a6a1f1dSLionel Sambuc // RUN:     -target x86_64-unknown-linux-gnu \
393*0a6a1f1dSLionel Sambuc // RUN:     -stdlib=libc++ \
394*0a6a1f1dSLionel Sambuc // RUN:     -ccc-install-dir %S/Inputs/basic_linux_libcxx_tree/usr/bin \
395*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
396*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_libcxx_tree \
397*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-BASIC-LIBCXX-INSTALL %s
398*0a6a1f1dSLionel Sambuc // CHECK-BASIC-LIBCXX-INSTALL: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
399*0a6a1f1dSLionel Sambuc // CHECK-BASIC-LIBCXX-INSTALL: "-isysroot" "[[SYSROOT:[^"]+]]"
400*0a6a1f1dSLionel Sambuc // CHECK-BASIC-LIBCXX-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/bin/../include/c++/v1"
401*0a6a1f1dSLionel Sambuc // CHECK-BASIC-LIBCXX-INSTALL: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
402*0a6a1f1dSLionel Sambuc // CHECK-BASIC-LIBCXX-INSTALL: "--sysroot=[[SYSROOT]]"
403*0a6a1f1dSLionel Sambuc // CHECK-BASIC-LIBCXX-INSTALL: "-L[[SYSROOT]]/usr/bin/../lib"
404*0a6a1f1dSLionel Sambuc //
405f4a2713aSLionel Sambuc // Test a very broken version of multiarch that shipped in Ubuntu 11.04.
406f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
407f4a2713aSLionel Sambuc // RUN:     --target=i386-unknown-linux \
408*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
409f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/ubuntu_11.04_multiarch_tree \
410f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-11-04 %s
411f4a2713aSLionel Sambuc // CHECK-UBUNTU-11-04: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
412f4a2713aSLionel Sambuc // CHECK-UBUNTU-11-04: "{{.*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
413f4a2713aSLionel Sambuc // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5"
414f4a2713aSLionel Sambuc // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../i386-linux-gnu"
415f4a2713aSLionel Sambuc // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu"
416f4a2713aSLionel Sambuc // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../.."
417f4a2713aSLionel Sambuc // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/lib"
418f4a2713aSLionel Sambuc // CHECK-UBUNTU-11-04: "-L[[SYSROOT]]/usr/lib"
419f4a2713aSLionel Sambuc //
420f4a2713aSLionel Sambuc // Check multi arch support on Ubuntu 12.04 LTS.
421f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
422f4a2713aSLionel Sambuc // RUN:     --target=arm-unknown-linux-gnueabihf \
423*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
424f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/ubuntu_12.04_LTS_multiarch_tree \
425f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-12-04-ARM-HF %s
426f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
427f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf{{/|\\\\}}crt1.o"
428f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf{{/|\\\\}}crti.o"
429f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3{{/|\\\\}}crtbegin.o"
430f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3"
431f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf"
432f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/lib/arm-linux-gnueabihf"
433f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/arm-linux-gnueabihf"
434f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../.."
435f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3{{/|\\\\}}crtend.o"
436f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM-HF: "{{.*}}/usr/lib/gcc/arm-linux-gnueabihf/4.6.3/../../../arm-linux-gnueabihf{{/|\\\\}}crtn.o"
437f4a2713aSLionel Sambuc //
438f4a2713aSLionel Sambuc // Check Ubuntu 13.10 on x86-64 targeting arm-linux-gnueabihf.
439f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
440f4a2713aSLionel Sambuc // RUN:     --target=arm-linux-gnueabihf \
441*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
442f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/x86-64_ubuntu_13.10 \
443f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-X86-64-UBUNTU-13-10-ARM-HF %s
444f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
445f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-dynamic-linker" "/lib/ld-linux-armhf.so.3"
446f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib{{/|\\\\}}crt1.o"
447f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib{{/|\\\\}}crti.o"
448f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8{{/|\\\\}}crtbegin.o"
449f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8"
450f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib"
451f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/lib/../lib"
452f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/../lib"
453f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib"
454f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8{{/|\\\\}}crtend.o"
455f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM-HF: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/lib/../lib{{/|\\\\}}crtn.o"
456f4a2713aSLionel Sambuc //
457f4a2713aSLionel Sambuc // Check Ubuntu 13.10 on x86-64 targeting arm-linux-gnueabi.
458f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
459f4a2713aSLionel Sambuc // RUN:     --target=arm-linux-gnueabi \
460*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
461f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/x86-64_ubuntu_13.10 \
462f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-X86-64-UBUNTU-13-10-ARM %s
463f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
464f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM: "-dynamic-linker" "/lib/ld-linux.so.3"
465f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib{{/|\\\\}}crt1.o"
466f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib{{/|\\\\}}crti.o"
467f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7{{/|\\\\}}crtbegin.o"
468f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabi/4.7"
469f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib"
470f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/lib/../lib"
471f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/../lib"
472f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM: "-L[[SYSROOT]]/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib"
473f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7{{/|\\\\}}crtend.o"
474f4a2713aSLionel Sambuc // CHECK-X86-64-UBUNTU-13-10-ARM: "{{.*}}/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib{{/|\\\\}}crtn.o"
475f4a2713aSLionel Sambuc //
476*0a6a1f1dSLionel Sambuc // Check Ubuntu 14.04 on powerpc64le.
477*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
478*0a6a1f1dSLionel Sambuc // RUN:     --target=powerpc64le-unknown-linux-gnu \
479*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
480*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/ubuntu_14.04_multiarch_tree \
481*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-14-04-PPC64LE %s
482*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
483*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../../powerpc64le-linux-gnu{{/|\\\\}}crt1.o"
484*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../../powerpc64le-linux-gnu{{/|\\\\}}crti.o"
485*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8{{/|\\\\}}crtbegin.o"
486*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.8"
487*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../../powerpc64le-linux-gnu"
488*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/lib/powerpc64le-linux-gnu"
489*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/usr/lib/powerpc64le-linux-gnu"
490*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-PPC64LE: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../.."
491*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8{{/|\\\\}}crtend.o"
492*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-PPC64LE: "{{.*}}/usr/lib/gcc/powerpc64le-linux-gnu/4.8/../../../powerpc64le-linux-gnu{{/|\\\\}}crtn.o"
493*0a6a1f1dSLionel Sambuc //
494*0a6a1f1dSLionel Sambuc // Check Ubuntu 14.04 on x32.
495*0a6a1f1dSLionel Sambuc // "/usr/lib/gcc/x86_64-linux-gnu/4.8/x32/crtend.o" "/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32/crtn.o"
496*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
497*0a6a1f1dSLionel Sambuc // RUN:     --target=x86_64-unknown-linux-gnux32 \
498*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
499*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/ubuntu_14.04_multiarch_tree \
500*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-14-04-X32 %s
501*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-X32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
502*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32{{/|\\\\}}crt1.o"
503*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32{{/|\\\\}}crti.o"
504*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/x32{{/|\\\\}}crtbegin.o"
505*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8/x32"
506*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32"
507*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/lib/../libx32"
508*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/../libx32"
509*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/x86_64-linux-gnu/../../libx32"
510*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8"
511*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-X32: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.."
512*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/x32{{/|\\\\}}crtend.o"
513*0a6a1f1dSLionel Sambuc // CHECK-UBUNTU-14-04-X32: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../libx32{{/|\\\\}}crtn.o"
514*0a6a1f1dSLionel Sambuc //
515f4a2713aSLionel Sambuc // Check fedora 18 on arm.
516f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
517f4a2713aSLionel Sambuc // RUN:     --target=armv7-unknown-linux-gnueabihf \
518*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
519f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/fedora_18_tree \
520f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-FEDORA-18-ARM-HF %s
521f4a2713aSLionel Sambuc // CHECK-FEDORA-18-ARM-HF: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
522f4a2713aSLionel Sambuc // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib{{/|\\\\}}crt1.o"
523f4a2713aSLionel Sambuc // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib{{/|\\\\}}crti.o"
524f4a2713aSLionel Sambuc // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2{{/|\\\\}}crtbegin.o"
525f4a2713aSLionel Sambuc // CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2"
526f4a2713aSLionel Sambuc // CHECK-FEDORA-18-ARM-HF: "-L[[SYSROOT]]/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib"
527f4a2713aSLionel Sambuc // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2{{/|\\\\}}crtend.o"
528f4a2713aSLionel Sambuc // CHECK-FEDORA-18-ARM-HF: "{{.*}}/usr/lib/gcc/armv7hl-redhat-linux-gnueabi/4.7.2/../../../../lib{{/|\\\\}}crtn.o"
529f4a2713aSLionel Sambuc //
530*0a6a1f1dSLionel Sambuc // Check Fedora 21 on AArch64.
531*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
532*0a6a1f1dSLionel Sambuc // RUN:     --target=arm64-unknown-linux-gnu \
533*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
534*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/fedora_21_tree \
535*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-FEDORA-21-AARCH64 %s
536*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
537*0a6a1f1dSLionel Sambuc // RUN:     --target=aarch64-unknown-linux-gnu \
538*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
539*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/fedora_21_tree \
540*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-FEDORA-21-AARCH64 %s
541*0a6a1f1dSLionel Sambuc // CHECK-FEDORA-21-AARCH64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
542*0a6a1f1dSLionel Sambuc // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|\\\\}}crt1.o"
543*0a6a1f1dSLionel Sambuc // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|\\\\}}crti.o"
544*0a6a1f1dSLionel Sambuc // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0{{/|\\\\}}crtbegin.o"
545*0a6a1f1dSLionel Sambuc // CHECK-FEDORA-21-AARCH64: "-L[[SYSROOT]]/usr/lib/gcc/aarch64-redhat-linux/4.9.0"
546*0a6a1f1dSLionel Sambuc // CHECK-FEDORA-21-AARCH64: "-L[[SYSROOT]]/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64"
547*0a6a1f1dSLionel Sambuc // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0{{/|\\\\}}crtend.o"
548*0a6a1f1dSLionel Sambuc // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|\\\\}}crtn.o"
549*0a6a1f1dSLionel Sambuc //
550f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
551f4a2713aSLionel Sambuc // RUN:     --target=arm-unknown-linux-gnueabi \
552*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
553f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/ubuntu_12.04_LTS_multiarch_tree \
554f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-UBUNTU-12-04-ARM %s
555f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
556f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi{{/|\\\\}}crt1.o"
557f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi{{/|\\\\}}crti.o"
558f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1{{/|\\\\}}crtbegin.o"
559f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1"
560f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi"
561f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/lib/arm-linux-gnueabi"
562f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/arm-linux-gnueabi"
563f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM: "-L[[SYSROOT]]/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../.."
564f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1{{/|\\\\}}crtend.o"
565f4a2713aSLionel Sambuc // CHECK-UBUNTU-12-04-ARM: "{{.*}}/usr/lib/gcc/arm-linux-gnueabi/4.6.1/../../../arm-linux-gnueabi{{/|\\\\}}crtn.o"
566f4a2713aSLionel Sambuc //
567f4a2713aSLionel Sambuc // Test the setup that shipped in SUSE 10.3 on ppc64.
568f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
569f4a2713aSLionel Sambuc // RUN:     --target=powerpc64-suse-linux \
570*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
571f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/suse_10.3_ppc64_tree \
572f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-SUSE-10-3-PPC64 %s
573f4a2713aSLionel Sambuc // CHECK-SUSE-10-3-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
574f4a2713aSLionel Sambuc // CHECK-SUSE-10-3-PPC64: "{{.*}}/usr/lib/gcc/powerpc64-suse-linux/4.1.2/64{{/|\\\\}}crtbegin.o"
575f4a2713aSLionel Sambuc // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/4.1.2/64"
576f4a2713aSLionel Sambuc // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-suse-linux/4.1.2/../../../../lib64"
577f4a2713aSLionel Sambuc // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/lib/../lib64"
578f4a2713aSLionel Sambuc // CHECK-SUSE-10-3-PPC64: "-L[[SYSROOT]]/usr/lib/../lib64"
579f4a2713aSLionel Sambuc //
580f4a2713aSLionel Sambuc // Check dynamic-linker for different archs
581f4a2713aSLionel Sambuc // RUN: %clang %s -### -o %t.o 2>&1 \
582f4a2713aSLionel Sambuc // RUN:     --target=arm-linux-gnueabi \
583f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ARM %s
584f4a2713aSLionel Sambuc // CHECK-ARM: "{{.*}}ld{{(.exe)?}}"
585f4a2713aSLionel Sambuc // CHECK-ARM: "-m" "armelf_linux_eabi"
586f4a2713aSLionel Sambuc // CHECK-ARM: "-dynamic-linker" "{{.*}}/lib/ld-linux.so.3"
587f4a2713aSLionel Sambuc //
588f4a2713aSLionel Sambuc // RUN: %clang %s -### -o %t.o 2>&1 \
589f4a2713aSLionel Sambuc // RUN:     --target=arm-linux-gnueabihf \
590f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ARM-HF %s
591f4a2713aSLionel Sambuc // CHECK-ARM-HF: "{{.*}}ld{{(.exe)?}}"
592f4a2713aSLionel Sambuc // CHECK-ARM-HF: "-m" "armelf_linux_eabi"
593f4a2713aSLionel Sambuc // CHECK-ARM-HF: "-dynamic-linker" "{{.*}}/lib/ld-linux-armhf.so.3"
594f4a2713aSLionel Sambuc //
595*0a6a1f1dSLionel Sambuc // RUN: %clang %s -### -o %t.o 2>&1 \
596*0a6a1f1dSLionel Sambuc // RUN:     --target=powerpc64-linux-gnu \
597*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-PPC64 %s
598*0a6a1f1dSLionel Sambuc // CHECK-PPC64: "{{.*}}ld{{(.exe)?}}"
599*0a6a1f1dSLionel Sambuc // CHECK-PPC64: "-m" "elf64ppc"
600*0a6a1f1dSLionel Sambuc // CHECK-PPC64: "-dynamic-linker" "{{.*}}/lib64/ld64.so.1"
601*0a6a1f1dSLionel Sambuc //
602*0a6a1f1dSLionel Sambuc // RUN: %clang %s -### -o %t.o 2>&1 \
603*0a6a1f1dSLionel Sambuc // RUN:     --target=powerpc64-linux-gnu -mabi=elfv1 \
604*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-PPC64-ELFv1 %s
605*0a6a1f1dSLionel Sambuc // CHECK-PPC64-ELFv1: "{{.*}}ld{{(.exe)?}}"
606*0a6a1f1dSLionel Sambuc // CHECK-PPC64-ELFv1: "-m" "elf64ppc"
607*0a6a1f1dSLionel Sambuc // CHECK-PPC64-ELFv1: "-dynamic-linker" "{{.*}}/lib64/ld64.so.1"
608*0a6a1f1dSLionel Sambuc //
609*0a6a1f1dSLionel Sambuc // RUN: %clang %s -### -o %t.o 2>&1 \
610*0a6a1f1dSLionel Sambuc // RUN:     --target=powerpc64-linux-gnu -mabi=elfv2 \
611*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-PPC64-ELFv2 %s
612*0a6a1f1dSLionel Sambuc // CHECK-PPC64-ELFv2: "{{.*}}ld{{(.exe)?}}"
613*0a6a1f1dSLionel Sambuc // CHECK-PPC64-ELFv2: "-m" "elf64ppc"
614*0a6a1f1dSLionel Sambuc // CHECK-PPC64-ELFv2: "-dynamic-linker" "{{.*}}/lib64/ld64.so.2"
615*0a6a1f1dSLionel Sambuc //
616*0a6a1f1dSLionel Sambuc // RUN: %clang %s -### -o %t.o 2>&1 \
617*0a6a1f1dSLionel Sambuc // RUN:     --target=powerpc64le-linux-gnu \
618*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-PPC64LE %s
619*0a6a1f1dSLionel Sambuc // CHECK-PPC64LE: "{{.*}}ld{{(.exe)?}}"
620*0a6a1f1dSLionel Sambuc // CHECK-PPC64LE: "-m" "elf64lppc"
621*0a6a1f1dSLionel Sambuc // CHECK-PPC64LE: "-dynamic-linker" "{{.*}}/lib64/ld64.so.2"
622*0a6a1f1dSLionel Sambuc //
623*0a6a1f1dSLionel Sambuc // RUN: %clang %s -### -o %t.o 2>&1 \
624*0a6a1f1dSLionel Sambuc // RUN:     --target=powerpc64le-linux-gnu -mabi=elfv1 \
625*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-PPC64LE-ELFv1 %s
626*0a6a1f1dSLionel Sambuc // CHECK-PPC64LE-ELFv1: "{{.*}}ld{{(.exe)?}}"
627*0a6a1f1dSLionel Sambuc // CHECK-PPC64LE-ELFv1: "-m" "elf64lppc"
628*0a6a1f1dSLionel Sambuc // CHECK-PPC64LE-ELFv1: "-dynamic-linker" "{{.*}}/lib64/ld64.so.1"
629*0a6a1f1dSLionel Sambuc //
630*0a6a1f1dSLionel Sambuc // RUN: %clang %s -### -o %t.o 2>&1 \
631*0a6a1f1dSLionel Sambuc // RUN:     --target=powerpc64le-linux-gnu -mabi=elfv2 \
632*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-PPC64LE-ELFv2 %s
633*0a6a1f1dSLionel Sambuc // CHECK-PPC64LE-ELFv2: "{{.*}}ld{{(.exe)?}}"
634*0a6a1f1dSLionel Sambuc // CHECK-PPC64LE-ELFv2: "-m" "elf64lppc"
635*0a6a1f1dSLionel Sambuc // CHECK-PPC64LE-ELFv2: "-dynamic-linker" "{{.*}}/lib64/ld64.so.2"
636*0a6a1f1dSLionel Sambuc //
637f4a2713aSLionel Sambuc // Check that we do not pass --hash-style=gnu and --hash-style=both to linker
638f4a2713aSLionel Sambuc // and provide correct path to the dynamic linker and emulation mode when build
639f4a2713aSLionel Sambuc // for MIPS platforms.
640f4a2713aSLionel Sambuc // RUN: %clang %s -### -o %t.o 2>&1 \
641f4a2713aSLionel Sambuc // RUN:     --target=mips-linux-gnu \
642f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-MIPS %s
643f4a2713aSLionel Sambuc // CHECK-MIPS: "{{.*}}ld{{(.exe)?}}"
644f4a2713aSLionel Sambuc // CHECK-MIPS: "-m" "elf32btsmip"
645f4a2713aSLionel Sambuc // CHECK-MIPS: "-dynamic-linker" "{{.*}}/lib/ld.so.1"
646f4a2713aSLionel Sambuc // CHECK-MIPS-NOT: "--hash-style={{gnu|both}}"
647*0a6a1f1dSLionel Sambuc //
648f4a2713aSLionel Sambuc // RUN: %clang %s -### -o %t.o 2>&1 \
649f4a2713aSLionel Sambuc // RUN:     --target=mipsel-linux-gnu \
650f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-MIPSEL %s
651f4a2713aSLionel Sambuc // CHECK-MIPSEL: "{{.*}}ld{{(.exe)?}}"
652f4a2713aSLionel Sambuc // CHECK-MIPSEL: "-m" "elf32ltsmip"
653f4a2713aSLionel Sambuc // CHECK-MIPSEL: "-dynamic-linker" "{{.*}}/lib/ld.so.1"
654f4a2713aSLionel Sambuc // CHECK-MIPSEL-NOT: "--hash-style={{gnu|both}}"
655*0a6a1f1dSLionel Sambuc //
656*0a6a1f1dSLionel Sambuc // RUN: %clang %s -### -o %t.o 2>&1 --target=mipsel-linux-gnu -mnan=2008 \
657*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-MIPSEL-NAN2008 %s
658*0a6a1f1dSLionel Sambuc // CHECK-MIPSEL-NAN2008: "{{.*}}ld{{(.exe)?}}"
659*0a6a1f1dSLionel Sambuc // CHECK-MIPSEL-NAN2008: "-m" "elf32ltsmip"
660*0a6a1f1dSLionel Sambuc // CHECK-MIPSEL-NAN2008: "-dynamic-linker" "{{.*}}/lib/ld-linux-mipsn8.so.1"
661*0a6a1f1dSLionel Sambuc // CHECK-MIPSEL-NAN2008-NOT: "--hash-style={{gnu|both}}"
662*0a6a1f1dSLionel Sambuc //
663*0a6a1f1dSLionel Sambuc // RUN: %clang %s -### -o %t.o 2>&1 --target=mipsel-linux-gnu -mcpu=mips32r6 \
664*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-MIPS32R6EL %s
665*0a6a1f1dSLionel Sambuc // CHECK-MIPS32R6EL: "{{.*}}ld{{(.exe)?}}"
666*0a6a1f1dSLionel Sambuc // CHECK-MIPS32R6EL: "-m" "elf32ltsmip"
667*0a6a1f1dSLionel Sambuc // CHECK-MIPS32R6EL: "-dynamic-linker" "{{.*}}/lib/ld-linux-mipsn8.so.1"
668*0a6a1f1dSLionel Sambuc // CHECK-MIPS32R6EL-NOT: "--hash-style={{gnu|both}}"
669*0a6a1f1dSLionel Sambuc //
670f4a2713aSLionel Sambuc // RUN: %clang %s -### -o %t.o 2>&1 \
671f4a2713aSLionel Sambuc // RUN:     --target=mips64-linux-gnu \
672f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-MIPS64 %s
673f4a2713aSLionel Sambuc // CHECK-MIPS64: "{{.*}}ld{{(.exe)?}}"
674f4a2713aSLionel Sambuc // CHECK-MIPS64: "-m" "elf64btsmip"
675f4a2713aSLionel Sambuc // CHECK-MIPS64: "-dynamic-linker" "{{.*}}/lib64/ld.so.1"
676f4a2713aSLionel Sambuc // CHECK-MIPS64-NOT: "--hash-style={{gnu|both}}"
677*0a6a1f1dSLionel Sambuc //
678f4a2713aSLionel Sambuc // RUN: %clang %s -### -o %t.o 2>&1 \
679f4a2713aSLionel Sambuc // RUN:     --target=mips64el-linux-gnu \
680f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-MIPS64EL %s
681f4a2713aSLionel Sambuc // CHECK-MIPS64EL: "{{.*}}ld{{(.exe)?}}"
682f4a2713aSLionel Sambuc // CHECK-MIPS64EL: "-m" "elf64ltsmip"
683f4a2713aSLionel Sambuc // CHECK-MIPS64EL: "-dynamic-linker" "{{.*}}/lib64/ld.so.1"
684f4a2713aSLionel Sambuc // CHECK-MIPS64EL-NOT: "--hash-style={{gnu|both}}"
685*0a6a1f1dSLionel Sambuc //
686*0a6a1f1dSLionel Sambuc // RUN: %clang %s -### -o %t.o 2>&1 --target=mips64el-linux-gnu -mnan=2008 \
687*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-MIPS64EL-NAN2008 %s
688*0a6a1f1dSLionel Sambuc // CHECK-MIPS64EL-NAN2008: "{{.*}}ld{{(.exe)?}}"
689*0a6a1f1dSLionel Sambuc // CHECK-MIPS64EL-NAN2008: "-m" "elf64ltsmip"
690*0a6a1f1dSLionel Sambuc // CHECK-MIPS64EL-NAN2008: "-dynamic-linker" "{{.*}}/lib64/ld-linux-mipsn8.so.1"
691*0a6a1f1dSLionel Sambuc // CHECK-MIPS64EL-NAN2008-NOT: "--hash-style={{gnu|both}}"
692*0a6a1f1dSLionel Sambuc //
693*0a6a1f1dSLionel Sambuc // RUN: %clang %s -### -o %t.o 2>&1 --target=mips64el-linux-gnu -mcpu=mips64r6 \
694*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-MIPS64R6EL %s
695*0a6a1f1dSLionel Sambuc // CHECK-MIPS64R6EL: "{{.*}}ld{{(.exe)?}}"
696*0a6a1f1dSLionel Sambuc // CHECK-MIPS64R6EL: "-m" "elf64ltsmip"
697*0a6a1f1dSLionel Sambuc // CHECK-MIPS64R6EL: "-dynamic-linker" "{{.*}}/lib64/ld-linux-mipsn8.so.1"
698*0a6a1f1dSLionel Sambuc // CHECK-MIPS64R6EL-NOT: "--hash-style={{gnu|both}}"
699*0a6a1f1dSLionel Sambuc //
700f4a2713aSLionel Sambuc // RUN: %clang %s -### -o %t.o 2>&1 \
701f4a2713aSLionel Sambuc // RUN:     --target=mips64-linux-gnu -mabi=n32 \
702f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-MIPS64-N32 %s
703f4a2713aSLionel Sambuc // CHECK-MIPS64-N32: "{{.*}}ld{{(.exe)?}}"
704f4a2713aSLionel Sambuc // CHECK-MIPS64-N32: "-m" "elf32btsmipn32"
705f4a2713aSLionel Sambuc // CHECK-MIPS64-N32: "-dynamic-linker" "{{.*}}/lib32/ld.so.1"
706f4a2713aSLionel Sambuc // CHECK-MIPS64-N32-NOT: "--hash-style={{gnu|both}}"
707*0a6a1f1dSLionel Sambuc //
708f4a2713aSLionel Sambuc // RUN: %clang %s -### -o %t.o 2>&1 \
709f4a2713aSLionel Sambuc // RUN:     --target=mips64el-linux-gnu -mabi=n32 \
710f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-MIPS64EL-N32 %s
711f4a2713aSLionel Sambuc // CHECK-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}"
712f4a2713aSLionel Sambuc // CHECK-MIPS64EL-N32: "-m" "elf32ltsmipn32"
713f4a2713aSLionel Sambuc // CHECK-MIPS64EL-N32: "-dynamic-linker" "{{.*}}/lib32/ld.so.1"
714f4a2713aSLionel Sambuc // CHECK-MIPS64EL-N32-NOT: "--hash-style={{gnu|both}}"
715f4a2713aSLionel Sambuc //
716*0a6a1f1dSLionel Sambuc // RUN: %clang %s -### -o %t.o 2>&1 --target=mips64el-linux-gnu -mabi=n32 \
717*0a6a1f1dSLionel Sambuc // RUN:   -mnan=2008 | FileCheck --check-prefix=CHECK-MIPS64EL-N32-NAN2008 %s
718*0a6a1f1dSLionel Sambuc // CHECK-MIPS64EL-N32-NAN2008: "{{.*}}ld{{(.exe)?}}"
719*0a6a1f1dSLionel Sambuc // CHECK-MIPS64EL-N32-NAN2008: "-m" "elf32ltsmipn32"
720*0a6a1f1dSLionel Sambuc // CHECK-MIPS64EL-N32-NAN2008: "-dynamic-linker" "{{.*}}/lib32/ld-linux-mipsn8.so.1"
721*0a6a1f1dSLionel Sambuc // CHECK-MIPS64EL-N32-NAN2008-NOT: "--hash-style={{gnu|both}}"
722*0a6a1f1dSLionel Sambuc //
723*0a6a1f1dSLionel Sambuc // RUN: %clang %s -### -o %t.o 2>&1 \
724*0a6a1f1dSLionel Sambuc // RUN:     --target=sparc-linux-gnu \
725*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-SPARCV8 %s
726*0a6a1f1dSLionel Sambuc // CHECK-SPARCV8: "{{.*}}ld{{(.exe)?}}"
727*0a6a1f1dSLionel Sambuc // CHECK-SPARCV8: "-m" "elf32_sparc"
728*0a6a1f1dSLionel Sambuc // CHECK-SPARCV8: "-dynamic-linker" "/lib/ld-linux.so.2"
729*0a6a1f1dSLionel Sambuc //
730*0a6a1f1dSLionel Sambuc // RUN: %clang %s -### -o %t.o 2>&1 \
731*0a6a1f1dSLionel Sambuc // RUN:     --target=sparcv9-linux-gnu \
732*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-SPARCV9 %s
733*0a6a1f1dSLionel Sambuc // CHECK-SPARCV9: "{{.*}}ld{{(.exe)?}}"
734*0a6a1f1dSLionel Sambuc // CHECK-SPARCV9: "-m" "elf64_sparc"
735*0a6a1f1dSLionel Sambuc // CHECK-SPARCV9: "-dynamic-linker" "/lib64/ld-linux.so.2"
736*0a6a1f1dSLionel Sambuc //
737f4a2713aSLionel Sambuc // Thoroughly exercise the Debian multiarch environment.
738f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
739f4a2713aSLionel Sambuc // RUN:     --target=i686-linux-gnu \
740*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
741f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
742f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-X86 %s
743f4a2713aSLionel Sambuc // CHECK-DEBIAN-X86: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
744f4a2713aSLionel Sambuc // CHECK-DEBIAN-X86: "{{.*}}/usr/lib/gcc/i686-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
745f4a2713aSLionel Sambuc // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5"
746f4a2713aSLionel Sambuc // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../../i386-linux-gnu"
747f4a2713aSLionel Sambuc // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/i386-linux-gnu"
748f4a2713aSLionel Sambuc // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib/gcc/i686-linux-gnu/4.5/../../.."
749f4a2713aSLionel Sambuc // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/lib"
750f4a2713aSLionel Sambuc // CHECK-DEBIAN-X86: "-L[[SYSROOT]]/usr/lib"
751f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
752f4a2713aSLionel Sambuc // RUN:     --target=x86_64-linux-gnu \
753*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
754f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
755f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-X86-64 %s
756f4a2713aSLionel Sambuc // CHECK-DEBIAN-X86-64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
757f4a2713aSLionel Sambuc // CHECK-DEBIAN-X86-64: "{{.*}}/usr/lib/gcc/x86_64-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
758f4a2713aSLionel Sambuc // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5"
759f4a2713aSLionel Sambuc // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../../x86_64-linux-gnu"
760f4a2713aSLionel Sambuc // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/x86_64-linux-gnu"
761f4a2713aSLionel Sambuc // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-linux-gnu/4.5/../../.."
762f4a2713aSLionel Sambuc // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/lib"
763f4a2713aSLionel Sambuc // CHECK-DEBIAN-X86-64: "-L[[SYSROOT]]/usr/lib"
764f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
765f4a2713aSLionel Sambuc // RUN:     --target=powerpc-linux-gnu \
766*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
767f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
768f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-PPC %s
769f4a2713aSLionel Sambuc // CHECK-DEBIAN-PPC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
770f4a2713aSLionel Sambuc // CHECK-DEBIAN-PPC: "{{.*}}/usr/lib/gcc/powerpc-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
771f4a2713aSLionel Sambuc // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5"
772f4a2713aSLionel Sambuc // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../../powerpc-linux-gnu"
773f4a2713aSLionel Sambuc // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/powerpc-linux-gnu"
774f4a2713aSLionel Sambuc // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib/gcc/powerpc-linux-gnu/4.5/../../.."
775f4a2713aSLionel Sambuc // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/lib"
776f4a2713aSLionel Sambuc // CHECK-DEBIAN-PPC: "-L[[SYSROOT]]/usr/lib"
777f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
778f4a2713aSLionel Sambuc // RUN:     --target=powerpc64-linux-gnu \
779*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
780f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
781f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-PPC64 %s
782f4a2713aSLionel Sambuc // CHECK-DEBIAN-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
783f4a2713aSLionel Sambuc // CHECK-DEBIAN-PPC64: "{{.*}}/usr/lib/gcc/powerpc64-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
784f4a2713aSLionel Sambuc // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5"
785f4a2713aSLionel Sambuc // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../../powerpc64-linux-gnu"
786f4a2713aSLionel Sambuc // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/powerpc64-linux-gnu"
787f4a2713aSLionel Sambuc // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib/gcc/powerpc64-linux-gnu/4.5/../../.."
788f4a2713aSLionel Sambuc // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/lib"
789f4a2713aSLionel Sambuc // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib"
790f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
791f4a2713aSLionel Sambuc // RUN:     --target=mips-linux-gnu \
792*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
793f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
794f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-MIPS %s
795f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
796f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
797f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5"
798f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../../mips-linux-gnu"
799f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/mips-linux-gnu"
800f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../.."
801f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/lib"
802f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS: "-L[[SYSROOT]]/usr/lib"
803f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
804f4a2713aSLionel Sambuc // RUN:     --target=mipsel-linux-gnu \
805*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
806f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
807f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-MIPSEL %s
808f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPSEL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
809f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5{{/|\\\\}}crtbegin.o"
810f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5"
811f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../../mipsel-linux-gnu"
812f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/mipsel-linux-gnu"
813f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.."
814f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/lib"
815f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPSEL: "-L[[SYSROOT]]/usr/lib"
816f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
817f4a2713aSLionel Sambuc // RUN:     --target=mips64-linux-gnu \
818*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
819f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
820f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64 %s
821f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
822f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5/64{{/|\\\\}}crtbegin.o"
823f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/64"
824f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5"
825f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../.."
826f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/lib"
827f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64: "-L[[SYSROOT]]/usr/lib"
828f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
829f4a2713aSLionel Sambuc // RUN:     --target=mips64el-linux-gnu \
830*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
831f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
832f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64EL %s
833f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64EL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
834f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5/64{{/|\\\\}}crtbegin.o"
835f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/64"
836f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5"
837f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.."
838f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/lib"
839f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64EL: "-L[[SYSROOT]]/usr/lib"
840f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
841f4a2713aSLionel Sambuc // RUN:     --target=mips64-linux-gnu -mabi=n32 \
842*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
843f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
844f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64-N32 %s
845f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
846f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64-N32: "{{.*}}/usr/lib/gcc/mips-linux-gnu/4.5/n32{{/|\\\\}}crtbegin.o"
847f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/n32"
848f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5"
849f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib/gcc/mips-linux-gnu/4.5/../../.."
850f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/lib"
851f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64-N32: "-L[[SYSROOT]]/usr/lib"
852f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
853f4a2713aSLionel Sambuc // RUN:     --target=mips64el-linux-gnu -mabi=n32 \
854*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
855f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/debian_multiarch_tree \
856f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-MIPS64EL-N32 %s
857f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
858f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.5/n32{{/|\\\\}}crtbegin.o"
859f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/n32"
860f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5"
861f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.5/../../.."
862f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/lib"
863f4a2713aSLionel Sambuc // CHECK-DEBIAN-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib"
864f4a2713aSLionel Sambuc //
865f4a2713aSLionel Sambuc // Test linker invocation on Android.
866f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
867f4a2713aSLionel Sambuc // RUN:     --target=arm-linux-androideabi \
868*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
869f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
870f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
871f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
872f4a2713aSLionel Sambuc // RUN:     --target=arm-linux-android \
873*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
874*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
875*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
876*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
877*0a6a1f1dSLionel Sambuc // RUN:     --target=aarch64-linux-android \
878*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
879*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
880*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
881*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
882*0a6a1f1dSLionel Sambuc // RUN:     --target=arm64-linux-android \
883*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
884f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
885f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
886f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
887f4a2713aSLionel Sambuc // RUN:     --target=mipsel-linux-android \
888*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
889f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
890f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
891f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
892*0a6a1f1dSLionel Sambuc // RUN:     --target=mips64el-linux-android \
893*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
894*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
895*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
896*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
897*0a6a1f1dSLionel Sambuc // RUN:     --target=i686-linux-android \
898*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
899*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
900*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
901*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
902*0a6a1f1dSLionel Sambuc // RUN:     --target=x86_64-linux-android \
903*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
904f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
905f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
906f4a2713aSLionel Sambuc // CHECK-ANDROID: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
907f4a2713aSLionel Sambuc // CHECK-ANDROID: "{{.*}}{{/|\\\\}}crtbegin_dynamic.o"
908f4a2713aSLionel Sambuc // CHECK-ANDROID: "-L[[SYSROOT]]/usr/lib"
909f4a2713aSLionel Sambuc // CHECK-ANDROID-NOT: "gcc_s"
910f4a2713aSLionel Sambuc // CHECK-ANDROID: "-lgcc"
911f4a2713aSLionel Sambuc // CHECK-ANDROID: "-ldl"
912f4a2713aSLionel Sambuc // CHECK-ANDROID-NOT: "gcc_s"
913f4a2713aSLionel Sambuc // CHECK-ANDROID: "{{.*}}{{/|\\\\}}crtend_android.o"
914f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
915f4a2713aSLionel Sambuc // RUN:     --target=arm-linux-androideabi \
916*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
917f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
918f4a2713aSLionel Sambuc // RUN:     -shared \
919f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
920f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
921f4a2713aSLionel Sambuc // RUN:     --target=arm-linux-android \
922*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
923*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
924*0a6a1f1dSLionel Sambuc // RUN:     -shared \
925*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
926*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
927*0a6a1f1dSLionel Sambuc // RUN:     --target=aarch64-linux-android \
928*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
929*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
930*0a6a1f1dSLionel Sambuc // RUN:     -shared \
931*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
932*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
933*0a6a1f1dSLionel Sambuc // RUN:     --target=arm64-linux-android \
934f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
935f4a2713aSLionel Sambuc // RUN:     -shared \
936f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
937f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
938f4a2713aSLionel Sambuc // RUN:     --target=mipsel-linux-android \
939*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
940f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
941f4a2713aSLionel Sambuc // RUN:     -shared \
942f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
943f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
944*0a6a1f1dSLionel Sambuc // RUN:     --target=mips64el-linux-android \
945*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
946*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
947*0a6a1f1dSLionel Sambuc // RUN:     -shared \
948*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
949*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
950*0a6a1f1dSLionel Sambuc // RUN:     --target=i686-linux-android \
951*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
952*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
953*0a6a1f1dSLionel Sambuc // RUN:     -shared \
954*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
955*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
956*0a6a1f1dSLionel Sambuc // RUN:     --target=x86_64-linux-android \
957*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
958f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
959f4a2713aSLionel Sambuc // RUN:     -shared \
960f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
961f4a2713aSLionel Sambuc // CHECK-ANDROID-SO: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
962*0a6a1f1dSLionel Sambuc // CHECK-ANDROID-SO-NOT: "-Bsymbolic"
963f4a2713aSLionel Sambuc // CHECK-ANDROID-SO: "{{.*}}{{/|\\\\}}crtbegin_so.o"
964f4a2713aSLionel Sambuc // CHECK-ANDROID-SO: "-L[[SYSROOT]]/usr/lib"
965f4a2713aSLionel Sambuc // CHECK-ANDROID-SO-NOT: "gcc_s"
966f4a2713aSLionel Sambuc // CHECK-ANDROID-SO: "-lgcc"
967f4a2713aSLionel Sambuc // CHECK-ANDROID-SO: "-ldl"
968f4a2713aSLionel Sambuc // CHECK-ANDROID-SO-NOT: "gcc_s"
969f4a2713aSLionel Sambuc // CHECK-ANDROID-SO: "{{.*}}{{/|\\\\}}crtend_so.o"
970f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
971f4a2713aSLionel Sambuc // RUN:     --target=arm-linux-androideabi \
972*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
973f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
974f4a2713aSLionel Sambuc // RUN:     -static \
975f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
976f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
977f4a2713aSLionel Sambuc // RUN:     --target=arm-linux-android \
978f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
979f4a2713aSLionel Sambuc // RUN:     -static \
980f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
981f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
982*0a6a1f1dSLionel Sambuc // RUN:     --target=aarch64-linux-android \
983*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
984f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
985f4a2713aSLionel Sambuc // RUN:     -static \
986f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
987f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
988*0a6a1f1dSLionel Sambuc // RUN:     --target=arm64-linux-android \
989*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
990*0a6a1f1dSLionel Sambuc // RUN:     -static \
991*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
992*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
993*0a6a1f1dSLionel Sambuc // RUN:     --target=mipsel-linux-android \
994*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
995*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
996*0a6a1f1dSLionel Sambuc // RUN:     -static \
997*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
998*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
999*0a6a1f1dSLionel Sambuc // RUN:     --target=mips64el-linux-android \
1000*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1001*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1002*0a6a1f1dSLionel Sambuc // RUN:     -static \
1003*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
1004*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1005*0a6a1f1dSLionel Sambuc // RUN:     --target=i686-linux-android \
1006*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1007*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1008*0a6a1f1dSLionel Sambuc // RUN:     -static \
1009*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
1010*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1011*0a6a1f1dSLionel Sambuc // RUN:     --target=x86_64-linux-android \
1012*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1013f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1014f4a2713aSLionel Sambuc // RUN:     -static \
1015f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
1016f4a2713aSLionel Sambuc // CHECK-ANDROID-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1017f4a2713aSLionel Sambuc // CHECK-ANDROID-STATIC: "{{.*}}{{/|\\\\}}crtbegin_static.o"
1018f4a2713aSLionel Sambuc // CHECK-ANDROID-STATIC: "-L[[SYSROOT]]/usr/lib"
1019f4a2713aSLionel Sambuc // CHECK-ANDROID-STATIC-NOT: "gcc_s"
1020f4a2713aSLionel Sambuc // CHECK-ANDROID-STATIC: "-lgcc"
1021f4a2713aSLionel Sambuc // CHECK-ANDROID-STATIC-NOT: "-ldl"
1022f4a2713aSLionel Sambuc // CHECK-ANDROID-STATIC-NOT: "gcc_s"
1023f4a2713aSLionel Sambuc // CHECK-ANDROID-STATIC: "{{.*}}{{/|\\\\}}crtend_android.o"
1024f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1025f4a2713aSLionel Sambuc // RUN:     --target=arm-linux-androideabi \
1026*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1027f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot  \
1028f4a2713aSLionel Sambuc // RUN:     -pie \
1029f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
1030f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1031f4a2713aSLionel Sambuc // RUN:     --target=arm-linux-android \
1032*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1033*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1034*0a6a1f1dSLionel Sambuc // RUN:     -pie \
1035*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
1036*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1037*0a6a1f1dSLionel Sambuc // RUN:     --target=aarch64-linux-android \
1038*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1039*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot  \
1040*0a6a1f1dSLionel Sambuc // RUN:     -pie \
1041*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
1042*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1043*0a6a1f1dSLionel Sambuc // RUN:     --target=arm64-linux-android \
1044*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1045f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot  \
1046f4a2713aSLionel Sambuc // RUN:     -pie \
1047f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
1048f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1049f4a2713aSLionel Sambuc // RUN:     --target=mipsel-linux-android \
1050*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1051f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1052f4a2713aSLionel Sambuc // RUN:     -pie \
1053f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
1054f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1055*0a6a1f1dSLionel Sambuc // RUN:     --target=mips64el-linux-android \
1056*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1057*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1058*0a6a1f1dSLionel Sambuc // RUN:     -pie \
1059*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
1060*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1061*0a6a1f1dSLionel Sambuc // RUN:     --target=i686-linux-android \
1062*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1063*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1064*0a6a1f1dSLionel Sambuc // RUN:     -pie \
1065*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
1066*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1067*0a6a1f1dSLionel Sambuc // RUN:     --target=x86_64-linux-android \
1068*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1069f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1070f4a2713aSLionel Sambuc // RUN:     -pie \
1071f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PIE %s
1072f4a2713aSLionel Sambuc // CHECK-ANDROID-PIE: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1073f4a2713aSLionel Sambuc // CHECK-ANDROID-PIE: "{{.*}}{{/|\\\\}}crtbegin_dynamic.o"
1074f4a2713aSLionel Sambuc // CHECK-ANDROID-PIE: "-L[[SYSROOT]]/usr/lib"
1075f4a2713aSLionel Sambuc // CHECK-ANDROID-PIE-NOT: "gcc_s"
1076f4a2713aSLionel Sambuc // CHECK-ANDROID-PIE: "-lgcc"
1077f4a2713aSLionel Sambuc // CHECK-ANDROID-PIE-NOT: "gcc_s"
1078f4a2713aSLionel Sambuc // CHECK-ANDROID-PIE: "{{.*}}{{/|\\\\}}crtend_android.o"
1079*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1080*0a6a1f1dSLionel Sambuc // RUN:     --target=arm-linux-androideabi \
1081*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1082*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1083*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-32 %s
1084*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1085*0a6a1f1dSLionel Sambuc // RUN:     --target=arm-linux-android \
1086*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1087*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1088*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-32 %s
1089*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1090*0a6a1f1dSLionel Sambuc // RUN:     --target=mipsel-linux-android \
1091*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1092*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1093*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-32 %s
1094*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1095*0a6a1f1dSLionel Sambuc // RUN:     --target=aarch64-linux-android \
1096*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1097*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1098*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-64 %s
1099*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1100*0a6a1f1dSLionel Sambuc // RUN:     --target=arm64-linux-android \
1101*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1102*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1103*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-64 %s
1104*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1105*0a6a1f1dSLionel Sambuc // RUN:     --target=mips64el-linux-android \
1106*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1107*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1108*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-64 %s
1109*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1110*0a6a1f1dSLionel Sambuc // RUN:     --target=i686-linux-android \
1111*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1112*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1113*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-32 %s
1114*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1115*0a6a1f1dSLionel Sambuc // RUN:     --target=x86_64-linux-android \
1116*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1117*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1118*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-64 %s
1119*0a6a1f1dSLionel Sambuc // CHECK-ANDROID-32: "-dynamic-linker" "/system/bin/linker"
1120*0a6a1f1dSLionel Sambuc // CHECK-ANDROID-64: "-dynamic-linker" "/system/bin/linker64"
1121*0a6a1f1dSLionel Sambuc //
1122*0a6a1f1dSLionel Sambuc // Test that -pthread does not add -lpthread on Android.
1123*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1124*0a6a1f1dSLionel Sambuc // RUN:     --target=arm-linux-androideabi -pthread \
1125*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1126*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1127*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1128*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1129*0a6a1f1dSLionel Sambuc // RUN:     --target=arm-linux-android -pthread \
1130*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1131*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1132*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1133*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1134*0a6a1f1dSLionel Sambuc // RUN:     --target=aarch64-linux-android -pthread \
1135*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1136*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1137*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1138*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1139*0a6a1f1dSLionel Sambuc // RUN:     --target=arm64-linux-android -pthread \
1140*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1141*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1142*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1143*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1144*0a6a1f1dSLionel Sambuc // RUN:     --target=mipsel-linux-android -pthread \
1145*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1146*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1147*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1148*0a6a1f1dSLionel Sambuc // RUN:     --target=mips64el-linux-android -pthread \
1149*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1150*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1151*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1152*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1153*0a6a1f1dSLionel Sambuc // RUN:     --target=i686-linux-android -pthread \
1154*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1155*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1156*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1157*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1158*0a6a1f1dSLionel Sambuc // RUN:     --target=x86_64-linux-android -pthread \
1159*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1160*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1161*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1162*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1163*0a6a1f1dSLionel Sambuc // RUN:     --target=arm-linux-androideabi -pthread \
1164*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1165*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1166*0a6a1f1dSLionel Sambuc // RUN:     -shared \
1167*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1168*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1169*0a6a1f1dSLionel Sambuc // RUN:     --target=arm-linux-android -pthread \
1170*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1171*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1172*0a6a1f1dSLionel Sambuc // RUN:     -shared \
1173*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1174*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1175*0a6a1f1dSLionel Sambuc // RUN:     --target=aarch64-linux-android -pthread \
1176*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1177*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1178*0a6a1f1dSLionel Sambuc // RUN:     -shared \
1179*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1180*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1181*0a6a1f1dSLionel Sambuc // RUN:     --target=arm64-linux-android -pthread \
1182*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1183*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1184*0a6a1f1dSLionel Sambuc // RUN:     -shared \
1185*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1186*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1187*0a6a1f1dSLionel Sambuc // RUN:     --target=mipsel-linux-android -pthread \
1188*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1189*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1190*0a6a1f1dSLionel Sambuc // RUN:     -shared \
1191*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1192*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1193*0a6a1f1dSLionel Sambuc // RUN:     --target=mips64el-linux-android -pthread \
1194*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1195*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1196*0a6a1f1dSLionel Sambuc // RUN:     -shared \
1197*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1198*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1199*0a6a1f1dSLionel Sambuc // RUN:     --target=i686-linux-android -pthread \
1200*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1201*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1202*0a6a1f1dSLionel Sambuc // RUN:     -shared \
1203*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1204*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1205*0a6a1f1dSLionel Sambuc // RUN:     --target=x86_64-linux-android -pthread \
1206*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1207*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1208*0a6a1f1dSLionel Sambuc // RUN:     -shared \
1209*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD %s
1210*0a6a1f1dSLionel Sambuc // CHECK-ANDROID-PTHREAD-NOT: -lpthread
1211*0a6a1f1dSLionel Sambuc //
1212*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %t.o -### -o %t 2>&1 \
1213*0a6a1f1dSLionel Sambuc // RUN:     --target=arm-linux-androideabi -pthread \
1214*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1215*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
1216*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-PTHREAD-LINK %s
1217*0a6a1f1dSLionel Sambuc // CHECK-ANDROID-PTHREAD-LINK-NOT: argument unused during compilation: '-pthread'
1218f4a2713aSLionel Sambuc //
1219f4a2713aSLionel Sambuc // Check linker invocation on Debian 6 MIPS 32/64-bit.
1220f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1221f4a2713aSLionel Sambuc // RUN:     --target=mipsel-linux-gnu \
1222*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1223f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/debian_6_mips_tree \
1224f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPSEL %s
1225f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1226f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib{{/|\\\\}}crt1.o"
1227f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib{{/|\\\\}}crti.o"
1228f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPSEL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4{{/|\\\\}}crtbegin.o"
1229f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4"
1230f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib"
1231f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/lib/../lib"
1232f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/../lib"
1233f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../.."
1234f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/lib"
1235f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPSEL: "-L[[SYSROOT]]/usr/lib"
1236f4a2713aSLionel Sambuc //
1237f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1238f4a2713aSLionel Sambuc // RUN:     --target=mips64el-linux-gnu \
1239*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1240f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/debian_6_mips_tree \
1241f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL %s
1242f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1243f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64{{/|\\\\}}crt1.o"
1244f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64{{/|\\\\}}crti.o"
1245f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/64{{/|\\\\}}crtbegin.o"
1246f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/64"
1247f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib64"
1248f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/lib/../lib64"
1249f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/../lib64"
1250f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../.."
1251f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/lib"
1252f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL: "-L[[SYSROOT]]/usr/lib"
1253f4a2713aSLionel Sambuc //
1254f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1255f4a2713aSLionel Sambuc // RUN:     --target=mips64el-linux-gnu -mabi=n32 \
1256*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1257f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/debian_6_mips_tree \
1258f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL-N32 %s
1259f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1260f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32{{/|\\\\}}crt1.o"
1261f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32{{/|\\\\}}crti.o"
1262f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-N32: "{{.*}}/usr/lib/gcc/mipsel-linux-gnu/4.4/n32{{/|\\\\}}crtbegin.o"
1263f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/n32"
1264f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../../../lib32"
1265f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/lib/../lib32"
1266f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/../lib32"
1267f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib/gcc/mipsel-linux-gnu/4.4/../../.."
1268f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/lib"
1269f4a2713aSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-N32: "-L[[SYSROOT]]/usr/lib"
1270f4a2713aSLionel Sambuc //
1271*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1272*0a6a1f1dSLionel Sambuc // RUN:     --target=mips64-linux-gnuabi64 -mabi=n64 \
1273*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1274*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/debian_6_mips64_tree \
1275*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64-GNUABI %s
1276*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1277*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../mips64-linux-gnuabi64{{/|\\\\}}crt1.o"
1278*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../mips64-linux-gnuabi64{{/|\\\\}}crti.o"
1279*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9{{/|\\\\}}crtbegin.o"
1280*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9"
1281*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../mips64-linux-gnuabi64"
1282*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/lib/mips64-linux-gnuabi64"
1283*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/mips64-linux-gnuabi64"
1284*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9"
1285*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../.."
1286*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/lib"
1287*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64-GNUABI: "-L[[SYSROOT]]/usr/lib"
1288*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9{{/|\\\\}}crtend.o"
1289*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64-GNUABI: "{{.*}}/usr/lib/gcc/mips64-linux-gnuabi64/4.9/../../../mips64-linux-gnuabi64{{/|\\\\}}crtn.o"
1290*0a6a1f1dSLionel Sambuc //
1291*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1292*0a6a1f1dSLionel Sambuc // RUN:     --target=mips64el-linux-gnuabi64 -mabi=n64 \
1293*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1294*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/debian_6_mips64_tree \
1295*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-DEBIAN-ML-MIPS64EL-GNUABI %s
1296*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1297*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../mips64el-linux-gnuabi64{{/|\\\\}}crt1.o"
1298*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../mips64el-linux-gnuabi64{{/|\\\\}}crti.o"
1299*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9{{/|\\\\}}crtbegin.o"
1300*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9"
1301*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../mips64el-linux-gnuabi64"
1302*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/lib/mips64el-linux-gnuabi64"
1303*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/mips64el-linux-gnuabi64"
1304*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9"
1305*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../.."
1306*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/lib"
1307*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "-L[[SYSROOT]]/usr/lib"
1308*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9{{/|\\\\}}crtend.o"
1309*0a6a1f1dSLionel Sambuc // CHECK-DEBIAN-ML-MIPS64EL-GNUABI: "{{.*}}/usr/lib/gcc/mips64el-linux-gnuabi64/4.9/../../../mips64el-linux-gnuabi64{{/|\\\\}}crtn.o"
1310*0a6a1f1dSLionel Sambuc //
1311f4a2713aSLionel Sambuc // Test linker invocation for Freescale SDK (OpenEmbedded).
1312f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1313f4a2713aSLionel Sambuc // RUN:     --target=powerpc-fsl-linux \
1314*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1315f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/freescale_ppc_tree \
1316f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-FSL-PPC %s
1317f4a2713aSLionel Sambuc // CHECK-FSL-PPC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1318f4a2713aSLionel Sambuc // CHECK-FSL-PPC: "-m" "elf32ppclinux"
1319f4a2713aSLionel Sambuc // CHECK-FSL-PPC: "{{.*}}{{/|\\\\}}crt1.o"
1320f4a2713aSLionel Sambuc // CHECK-FSL-PPC: "{{.*}}{{/|\\\\}}crtbegin.o"
1321f4a2713aSLionel Sambuc // CHECK-FSL-PPC: "-L[[SYSROOT]]/usr/lib"
1322f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1323f4a2713aSLionel Sambuc // RUN:     --target=powerpc64-fsl-linux \
1324*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1325f4a2713aSLionel Sambuc // RUN:     --sysroot=%S/Inputs/freescale_ppc64_tree \
1326f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-FSL-PPC64 %s
1327f4a2713aSLionel Sambuc // CHECK-FSL-PPC64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1328f4a2713aSLionel Sambuc // CHECK-FSL-PPC64: "-m" "elf64ppc"
1329f4a2713aSLionel Sambuc // CHECK-FSL-PPC64: "{{.*}}{{/|\\\\}}crt1.o"
1330f4a2713aSLionel Sambuc // CHECK-FSL-PPC64: "{{.*}}{{/|\\\\}}crtbegin.o"
1331f4a2713aSLionel Sambuc // CHECK-FSL-PPC64: "-L[[SYSROOT]]/usr/lib64/powerpc64-fsl-linux/4.6.2/../.."
1332f4a2713aSLionel Sambuc //
1333*0a6a1f1dSLionel Sambuc // Check that crtfastmath.o is linked with -ffast-math and with -Ofast.
1334f4a2713aSLionel Sambuc // RUN: %clang --target=x86_64-unknown-linux -### %s \
1335*0a6a1f1dSLionel Sambuc // RUN:        --gcc-toolchain="" \
1336f4a2713aSLionel Sambuc // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1337f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
1338f4a2713aSLionel Sambuc // RUN: %clang --target=x86_64-unknown-linux -### %s -ffast-math \
1339*0a6a1f1dSLionel Sambuc // RUN:        --gcc-toolchain="" \
1340f4a2713aSLionel Sambuc // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1341f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
1342f4a2713aSLionel Sambuc // RUN: %clang --target=x86_64-unknown-linux -### %s -funsafe-math-optimizations\
1343*0a6a1f1dSLionel Sambuc // RUN:        --gcc-toolchain="" \
1344*0a6a1f1dSLionel Sambuc // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1345*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
1346*0a6a1f1dSLionel Sambuc // RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast\
1347*0a6a1f1dSLionel Sambuc // RUN:        --gcc-toolchain="" \
1348*0a6a1f1dSLionel Sambuc // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1349*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
1350*0a6a1f1dSLionel Sambuc // RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast -O3\
1351*0a6a1f1dSLionel Sambuc // RUN:        --gcc-toolchain="" \
1352*0a6a1f1dSLionel Sambuc // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1353*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
1354*0a6a1f1dSLionel Sambuc // RUN: %clang --target=x86_64-unknown-linux -### %s -O3 -Ofast\
1355*0a6a1f1dSLionel Sambuc // RUN:        --gcc-toolchain="" \
1356f4a2713aSLionel Sambuc // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1357f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
1358f4a2713aSLionel Sambuc // RUN: %clang --target=x86_64-unknown-linux -### %s -ffast-math -fno-fast-math \
1359*0a6a1f1dSLionel Sambuc // RUN:        --gcc-toolchain="" \
1360f4a2713aSLionel Sambuc // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1361f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
1362*0a6a1f1dSLionel Sambuc // RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast -fno-fast-math \
1363*0a6a1f1dSLionel Sambuc // RUN:        --gcc-toolchain="" \
1364*0a6a1f1dSLionel Sambuc // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1365*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
1366*0a6a1f1dSLionel Sambuc // RUN: %clang --target=x86_64-unknown-linux -### %s -Ofast -fno-unsafe-math-optimizations \
1367*0a6a1f1dSLionel Sambuc // RUN:        --gcc-toolchain="" \
1368*0a6a1f1dSLionel Sambuc // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1369*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
1370*0a6a1f1dSLionel Sambuc // RUN: %clang --target=x86_64-unknown-linux -### %s -fno-fast-math -Ofast  \
1371*0a6a1f1dSLionel Sambuc // RUN:        --gcc-toolchain="" \
1372*0a6a1f1dSLionel Sambuc // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1373*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
1374*0a6a1f1dSLionel Sambuc // RUN: %clang --target=x86_64-unknown-linux -### %s -fno-unsafe-math-optimizations -Ofast \
1375*0a6a1f1dSLionel Sambuc // RUN:        --gcc-toolchain="" \
1376*0a6a1f1dSLionel Sambuc // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1377*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-CRTFASTMATH %s
1378f4a2713aSLionel Sambuc // We don't have crtfastmath.o in the i386 tree, use it to check that file
1379f4a2713aSLionel Sambuc // detection works.
1380f4a2713aSLionel Sambuc // RUN: %clang --target=i386-unknown-linux -### %s -ffast-math \
1381*0a6a1f1dSLionel Sambuc // RUN:        --gcc-toolchain="" \
1382f4a2713aSLionel Sambuc // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
1383f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
1384f4a2713aSLionel Sambuc // CHECK-CRTFASTMATH: usr/lib/gcc/x86_64-unknown-linux/4.6.0{{/|\\\\}}crtfastmath.o
1385f4a2713aSLionel Sambuc // CHECK-NOCRTFASTMATH-NOT: crtfastmath.o
1386f4a2713aSLionel Sambuc 
1387f4a2713aSLionel Sambuc // Check that we link in gcrt1.o when compiling with -pg
1388f4a2713aSLionel Sambuc // RUN: %clang -pg --target=x86_64-unknown-linux -### %s \
1389*0a6a1f1dSLionel Sambuc // RUN:        --gcc-toolchain="" \
1390f4a2713aSLionel Sambuc // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>& 1 \
1391f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-PG %s
1392f4a2713aSLionel Sambuc // CHECK-PG: gcrt1.o
1393*0a6a1f1dSLionel Sambuc 
1394*0a6a1f1dSLionel Sambuc // GCC forwards -u to the linker.
1395*0a6a1f1dSLionel Sambuc // RUN: %clang -u asdf --target=x86_64-unknown-linux -### %s \
1396*0a6a1f1dSLionel Sambuc // RUN:        --gcc-toolchain="" \
1397*0a6a1f1dSLionel Sambuc // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>& 1 \
1398*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-u %s
1399*0a6a1f1dSLionel Sambuc // CHECK-u: "-u" "asdf"
1400*0a6a1f1dSLionel Sambuc 
1401*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1402*0a6a1f1dSLionel Sambuc // RUN:     --target=armeb-unknown-linux \
1403*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1404*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
1405*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ARMEB %s
1406*0a6a1f1dSLionel Sambuc // CHECK-ARMEB: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1407*0a6a1f1dSLionel Sambuc // CHECK-ARMEB-NOT: "--be8"
1408*0a6a1f1dSLionel Sambuc // CHECK-ARMEB: "-m" "armebelf_linux_eabi"
1409*0a6a1f1dSLionel Sambuc 
1410*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
1411*0a6a1f1dSLionel Sambuc // RUN:     --target=armebv7-unknown-linux \
1412*0a6a1f1dSLionel Sambuc // RUN:     --gcc-toolchain="" \
1413*0a6a1f1dSLionel Sambuc // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
1414*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-ARMV7EB %s
1415*0a6a1f1dSLionel Sambuc // CHECK-ARMV7EB: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
1416*0a6a1f1dSLionel Sambuc // CHECK-ARMV7EB: "--be8"
1417*0a6a1f1dSLionel Sambuc // CHECK-ARMV7EB: "-m" "armebelf_linux_eabi"
1418