1 // Test ld invocation on Solaris targets.
2 
3 // Check sparc-sun-solaris2.1
4 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
5 // RUN:     --target=sparc-sun-solaris2.11 \
6 // RUN:     --gcc-toolchain="" \
7 // RUN:     --sysroot=%S/Inputs/sparc-sun-solaris2.11 \
8 // RUN:   | FileCheck %s
9 // CHECK: "-cc1" "-triple" "sparc-sun-solaris2.11"
10 // CHECK: ld{{.*}}"
11 // CHECK: "--dynamic-linker" "{{.*}}/usr/lib/ld.so.1"
12 // CHECK: "{{.*}}/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2{{/|\\\\}}crt1.o"
13 // CHECK: "{{.*}}/usr/lib/crti.o"
14 // CHECK: "{{.*}}/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2{{/|\\\\}}crtbegin.o"
15 // CHECK: "{{.*}}/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2{{/|\\\\}}crtend.o"
16 // CHECK: "{{.*}}/usr/lib/crtn.o"
17 // CHECK "-lc"
18 // CHECK "-lgcc_s"
19 // CHECK "-lgcc"
20 // CHECK "-lm"
21 
22 // Check the right -l flags are present with -shared
23 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o -shared 2>&1 \
24 // RUN:     --target=sparc-sun-solaris2.11 \
25 // RUN:     --gcc-toolchain="" \
26 // RUN:     --sysroot=%S/Inputs/sparc-sun-solaris2.11 \
27 // RUN:   | FileCheck --check-prefix=CHECK-SHARED %s
28 
29 // CHECK-SHARED: ld{{.*}}"
30 // CHECK-SHARED "-lc"
31 // CHECK-SHARED "-lgcc_s"
32 // CHECK-SHARED-NOT "-lgcc"
33 // CHECK-SHARED-NOT: "-lm"
34