Debian Codegraph @

clang/test/Driver/ps4-linker.c

raw
1 // Test that -static is forwarded to the linker
2
3 // RUN: %clang --target=x86_64-scei-ps4 -static %s -### 2>&1 | FileCheck --check-prefixes=CHECK-STATIC %s
4
5 // CHECK-STATIC: {{ld(\.exe)?}}"
6 // CHECK-STATIC-SAME: "-static"
7
8 // Test the driver's control over the JustMyCode behavior with linker flags.
9
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
13
14 // CHECK-LTO: "-lto-debug-options= -enable-jmc-instrument"
15
16 // Check the default library name.
17 // CHECK-LIB: "--whole-archive" "-lSceDbgJmc" "--no-whole-archive"
18
19 // Test the driver's control over the -fcrash-diagnostics-dir behavior with linker flags.
20
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
24
25 // CHECK-DIAG-LTO: "-lto-debug-options= -crash-diagnostics-dir=mydumps"
26
27 // Test that -lto-debug-options is only supplied to the linker when necessary
28
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
31
32 // Test the driver passes a sysroot to the linker. Without --sysroot, its value
33 // is sourced from the SDK environment variable.
34
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
37
38 // CHECK-SYSROOT: {{ld(\.exe)?}}"
39 // CHECK-SYSROOT-SAME: "--sysroot=mysdk"