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