|
97 | 97 | // Check the default library name. |
98 | 98 | // CHECK-JMC: "--push-state" "--whole-archive" "-lSceJmc_nosubmission" "--pop-state" |
99 | 99 |
|
| 100 | +// Test that CRT objects and libraries are supplied to the linker and can be |
| 101 | +// omitted with -noxxx options. These switches have some interaction with |
| 102 | +// sanitizer RT libraries. That's checked in fsanitize.c |
| 103 | + |
| 104 | +// RUN: %clang --target=x86_64-sie-ps5 %s -### 2>&1 | FileCheck --check-prefixes=CHECK-LD,CHECK-MAIN-CRT,CHECK-DYNAMIC-LIBC,CHECK-DYNAMIC-CORE-LIBS %s |
| 105 | +// RUN: %clang --target=x86_64-sie-ps5 %s -shared -### 2>&1 | FileCheck --check-prefixes=CHECK-LD,CHECK-SHARED-CRT,CHECK-DYNAMIC-LIBC,CHECK-DYNAMIC-CORE-LIBS %s |
| 106 | +// RUN: %clang --target=x86_64-sie-ps5 %s -static -### 2>&1 | FileCheck --check-prefixes=CHECK-LD,CHECK-STATIC-CRT,CHECK-STATIC-LIBCPP,CHECK-STATIC-LIBC,CHECK-STATIC-CORE-LIBS %s |
| 107 | +// RUN: %clang --target=x86_64-sie-ps5 %s -r -### 2>&1 | FileCheck --check-prefixes=CHECK-LD,CHECK-NO-CRT,CHECK-NO-LIBS %s |
| 108 | + |
| 109 | +// RUN: %clang --target=x86_64-sie-ps5 %s -pthread -### 2>&1 | FileCheck --check-prefixes=CHECK-LD,CHECK-PTHREAD %s |
| 110 | + |
| 111 | +// RUN: %clang --target=x86_64-sie-ps5 %s -nostartfiles -### 2>&1 | FileCheck --check-prefixes=CHECK-LD,CHECK-NO-CRT,CHECK-DYNAMIC-LIBC,CHECK-DYNAMIC-CORE-LIBS %s |
| 112 | +// RUN: %clang --target=x86_64-sie-ps5 %s -nostartfiles -shared -### 2>&1 | FileCheck --check-prefixes=CHECK-LD,CHECK-NO-CRT,CHECK-DYNAMIC-LIBC,CHECK-DYNAMIC-CORE-LIBS %s |
| 113 | +// RUN: %clang --target=x86_64-sie-ps5 %s -nostartfiles -static -### 2>&1 | FileCheck --check-prefixes=CHECK-LD,CHECK-NO-CRT,CHECK-STATIC-LIBCPP,CHECK-STATIC-LIBC,CHECK-STATIC-CORE-LIBS %s |
| 114 | + |
| 115 | +// RUN: %clang --target=x86_64-sie-ps5 %s -nodefaultlibs -pthread -fjmc -### 2>&1 | FileCheck --check-prefixes=CHECK-LD,CHECK-MAIN-CRT,CHECK-NO-LIBS %s |
| 116 | +// RUN: %clang --target=x86_64-sie-ps5 %s -nodefaultlibs -pthread -fjmc -shared -### 2>&1 | FileCheck --check-prefixes=CHECK-LD,CHECK-SHARED-CRT,CHECK-NO-LIBS %s |
| 117 | +// RUN: %clang --target=x86_64-sie-ps5 %s -nodefaultlibs -pthread -fjmc -static -### 2>&1 | FileCheck --check-prefixes=CHECK-LD,CHECK-STATIC-CRT,CHECK-NO-LIBS %s |
| 118 | + |
| 119 | +// RUN: %clang --target=x86_64-sie-ps5 %s -nostdlib -pthread -fjmc -### 2>&1 | FileCheck --check-prefixes=CHECK-LD,CHECK-NO-CRT,CHECK-NO-LIBS %s |
| 120 | +// RUN: %clang --target=x86_64-sie-ps5 %s -nostdlib -pthread -fjmc -shared -### 2>&1 | FileCheck --check-prefixes=CHECK-LD,CHECK-NO-CRT,CHECK-NO-LIBS %s |
| 121 | +// RUN: %clang --target=x86_64-sie-ps5 %s -nostdlib -pthread -fjmc -static -### 2>&1 | FileCheck --check-prefixes=CHECK-LD,CHECK-NO-CRT,CHECK-NO-LIBS %s |
| 122 | + |
| 123 | +// RUN: %clang --target=x86_64-sie-ps5 %s -nolibc -### 2>&1 | FileCheck --check-prefixes=CHECK-LD,CHECK-MAIN-CRT,CHECK-NO-LIBC,CHECK-DYNAMIC-CORE-LIBS %s |
| 124 | +// RUN: %clang --target=x86_64-sie-ps5 %s -nolibc -shared -### 2>&1 | FileCheck --check-prefixes=CHECK-LD,CHECK-SHARED-CRT,CHECK-NO-LIBC,CHECK-DYNAMIC-CORE-LIBS %s |
| 125 | +// RUN: %clang --target=x86_64-sie-ps5 %s -nolibc -static -### 2>&1 | FileCheck --check-prefixes=CHECK-LD,CHECK-STATIC-CRT,CHECK-STATIC-LIBCPP,CHECK-NO-LIBC,CHECK-STATIC-CORE-LIBS %s |
| 126 | + |
| 127 | +// RUN: %clang --target=x86_64-sie-ps5 %s -nostdlib++ -### 2>&1 | FileCheck --check-prefixes=CHECK-LD,CHECK-MAIN-CRT,CHECK-NO-LIBCPP,CHECK-DYNAMIC-CORE-LIBS %s |
| 128 | +// RUN: %clang --target=x86_64-sie-ps5 %s -nostdlib++ -shared -### 2>&1 | FileCheck --check-prefixes=CHECK-LD,CHECK-SHARED-CRT,CHECK-NO-LIBCPP,CHECK-DYNAMIC-CORE-LIBS %s |
| 129 | +// RUN: %clang --target=x86_64-sie-ps5 %s -nostdlib++ -static -### 2>&1 | FileCheck --check-prefixes=CHECK-LD,CHECK-STATIC-CRT,CHECK-NO-LIBCPP,CHECK-STATIC-LIBC,CHECK-STATIC-CORE-LIBS %s |
| 130 | + |
| 131 | +// CHECK-LD: {{ld(\.exe)?}}" |
| 132 | +// CHECK-MAIN-CRT-SAME: "crt1.o" "crti.o" "crtbegin.o" |
| 133 | +// CHECK-SHARED-CRT-SAME: "crti.o" "crtbeginS.o" |
| 134 | +// CHECK-STATIC-CRT-SAMW: "crt1.o" "crti.o" "crtbeginT.o" |
| 135 | + |
| 136 | +// CHECK-NO-LIBC-NOT: "-lc{{(_stub_weak)?}}" |
| 137 | +// CHECK-NO-LIBCPP-NOT: "-l{{c_stub_weak|stdc\+\+}}" |
| 138 | + |
| 139 | +// CHECK-DYNAMIC-LIBC-SAME: "-lc_stub_weak" |
| 140 | +// CHECK-DYNAMIC-CORE-LIBS-SAME: "-lkernel_stub_weak" |
| 141 | +// CHECK-STATIC-LIBCPP-SAME: "-lstdc++" |
| 142 | +// CHECK-STATIC-LIBC-SAME: "-lm" "-lc" |
| 143 | +// CHECK-STATIC-CORE-LIBS-SAME: "-lcompiler_rt" "-lkernel" |
| 144 | + |
| 145 | +// CHECK-PTHREAD-SAME: "-lpthread" |
| 146 | + |
| 147 | +// CHECK-MAIN-CRT-SAME: "crtend.o" "crtn.o" |
| 148 | +// CHECK-SHARED-CRT-SAME: "crtendS.o" "crtn.o" |
| 149 | +// CHECK-STATIC-CRT-SAME: "crtend.o" "crtn.o" |
| 150 | + |
| 151 | +// CHECK-NO-CRT-NOT: "crt{{[^"]*}}.o" |
| 152 | +// CHECK-NO-LIBS-NOT: "-l{{[^"]*}}" |
| 153 | + |
100 | 154 | // Test the driver's control over the -fcrash-diagnostics-dir behavior with linker flags. |
101 | 155 |
|
102 | 156 | // RUN: %clang --target=x86_64-sie-ps5 -fcrash-diagnostics-dir=mydumps %s -### 2>&1 | FileCheck --check-prefixes=CHECK-DIAG %s |
|
122 | 176 | // CHECK-LDOT-SAME: "-L." |
123 | 177 |
|
124 | 178 | // Test that <sdk-root>/target/lib is added to library search paths, if it |
125 | | -// exists and no --sysroot is specified. |
| 179 | +// exists and no --sysroot is specified. Also confirm that CRT objects are |
| 180 | +// found there. |
126 | 181 |
|
127 | 182 | // RUN: rm -rf %t.dir && mkdir %t.dir |
128 | 183 | // RUN: env SCE_PROSPERO_SDK_DIR=%t.dir %clang --target=x64_64-sie-ps5 %s -### 2>&1 | FileCheck --check-prefixes=CHECK-NO-TARGETLIB %s |
|
132 | 187 | // CHECK-NO-TARGETLIB-NOT: "-L{{.*[/\\]}}target/lib" |
133 | 188 |
|
134 | 189 | // RUN: mkdir -p %t.dir/target/lib |
| 190 | +// RUN: touch %t.dir/target/lib/crti.o |
135 | 191 | // RUN: env SCE_PROSPERO_SDK_DIR=%t.dir %clang --target=x64_64-sie-ps5 %s -### 2>&1 | FileCheck --check-prefixes=CHECK-TARGETLIB %s |
136 | 192 |
|
137 | 193 | // CHECK-TARGETLIB: {{ld(\.exe)?}}" |
138 | 194 | // CHECK-TARGETLIB-SAME: "-L{{.*[/\\]}}target/lib" |
| 195 | +// CHECK-TARGETLIB-SAME: "{{.*[/\\]}}target{{/|\\\\}}lib{{/|\\\\}}crti.o" |
0 commit comments