1 // Test that -static is forwarded to the linker
3 // RUN: %clang --target=x86_64-scei-ps4 -static %s -### 2>&1 | FileCheck --check-prefixes=CHECK-STATIC %s
5 // CHECK-STATIC: {{ld(\.exe)?}}"
6 // CHECK-STATIC-SAME: "-static"
8 // Test the driver's control over the JustMyCode behavior with linker flags.
10 // RUN: %clang --target=x86_64-scei-ps4 -fjmc %s -### 2>&1 | FileCheck --check-prefixes=CHECK-LTO,CHECK-LIB %s
11 // RUN: %clang --target=x86_64-scei-ps4 -flto=thin -fjmc %s -### 2>&1 | FileCheck --check-prefixes=CHECK-LTO,CHECK-LIB %s
12 // RUN: %clang --target=x86_64-scei-ps4 -flto=full -fjmc %s -### 2>&1 | FileCheck --check-prefixes=CHECK-LTO,CHECK-LIB %s
14 // CHECK-LTO: "-lto-debug-options= -enable-jmc-instrument"
16 // Check the default library name.
17 // CHECK-LIB: "--whole-archive" "-lSceDbgJmc" "--no-whole-archive"
19 // Test the driver's control over the -fcrash-diagnostics-dir behavior with linker flags.
21 // RUN: %clang --target=x86_64-scei-ps4 -fcrash-diagnostics-dir=mydumps %s -### 2>&1 | FileCheck --check-prefixes=CHECK-DIAG-LTO %s
22 // RUN: %clang --target=x86_64-scei-ps4 -flto=thin -fcrash-diagnostics-dir=mydumps %s -### 2>&1 | FileCheck --check-prefixes=CHECK-DIAG-LTO %s
23 // RUN: %clang --target=x86_64-scei-ps4 -flto=full -fcrash-diagnostics-dir=mydumps %s -### 2>&1 | FileCheck --check-prefixes=CHECK-DIAG-LTO %s
25 // CHECK-DIAG-LTO: "-lto-debug-options= -crash-diagnostics-dir=mydumps"
27 // Test that -lto-debug-options is only supplied to the linker when necessary
29 // RUN: %clang --target=x86_64-scei-ps4 %s -### 2>&1 | FileCheck --check-prefixes=CHECK-NO-LTO %s
30 // CHECK-NO-LTO-NOT: -lto-debug-options
32 // Test the driver passes a sysroot to the linker. Without --sysroot, its value
33 // is sourced from the SDK environment variable.
35 // RUN: env SCE_ORBIS_SDK_DIR=mysdk %clang --target=x64_64-scei-ps4 %s -### 2>&1 | FileCheck --check-prefixes=CHECK-SYSROOT %s
36 // RUN: env SCE_ORBIS_SDK_DIR=other %clang --target=x64_64-scei-ps4 %s -### --sysroot=mysdk 2>&1 | FileCheck --check-prefixes=CHECK-SYSROOT %s
38 // CHECK-SYSROOT: {{ld(\.exe)?}}"
39 // CHECK-SYSROOT-SAME: "--sysroot=mysdk"