[Driver][test] Change some -fuse-ld=lld tests to be agnostic of host ld.lld
If program paths (GCC installation, --sysroot, -B, etc) don't contain ld.lld, whether -fuse-ld=lld succeeds depends on whether a PATH directory contains ld.lld. > error: invalid linker name in argument '-fuse-ld=lld' This behavior is not suitable when we adopt the new strict behavior of -### in D156363. For some tests, append -B%S/Inputs/lld similar to D92028. For others, use -fuse-ld=ld so that getDefaultLinker (instead of CLANG_DEFAULT_LINKER) is used. The complexity stems from CLANG_DEFAULT_LINKER.
This commit is contained in:
0
clang/test/Driver/Inputs/lld/ld.lld
Executable file
0
clang/test/Driver/Inputs/lld/ld.lld
Executable file
@@ -4,10 +4,6 @@
|
||||
// RUN: %clang -### %s --target=csky 2>&1 | FileCheck -check-prefix=CC1 %s
|
||||
// CC1: "-cc1" "-triple" "csky"
|
||||
|
||||
// Test interaction with -fuse-ld=lld, if lld is available.
|
||||
// RUN: %clang -### %s --target=csky -fuse-ld=lld 2>&1 | FileCheck -check-prefix=LLD %s
|
||||
// LLD: {{(error: invalid linker name in argument '-fuse-ld=lld')|(ld.lld)}}
|
||||
|
||||
// In the below tests, --rtlib=platform is used so that the driver ignores
|
||||
// the configure-time CLANG_DEFAULT_RTLIB option when choosing the runtime lib
|
||||
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=lld 2>&1 \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck -check-prefixes=CHECK,CHECK-X86_64 %s
|
||||
// RUN: %clang -### %s --target=aarch64-unknown-fuchsia \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=lld 2>&1 \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck -check-prefixes=CHECK,CHECK-AARCH64 %s
|
||||
// RUN: %clang -### %s --target=riscv64-unknown-fuchsia \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=lld 2>&1 \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck -check-prefixes=CHECK,CHECK-RISCV64 %s
|
||||
// RUN: %clang -### %s --target=x86_64-fuchsia \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=lld 2>&1 \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck -check-prefixes=CHECK,CHECK-X86_64 %s
|
||||
// RUN: %clang -### %s --target=aarch64-fuchsia \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=lld 2>&1 \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck -check-prefixes=CHECK,CHECK-AARCH64 %s
|
||||
// RUN: %clang -### %s --target=riscv64-fuchsia \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=lld 2>&1 \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck -check-prefixes=CHECK,CHECK-RISCV64 %s
|
||||
// CHECK: "-cc1"
|
||||
// CHECK-X86_64: "-triple" "x86_64-unknown-fuchsia"
|
||||
@@ -71,22 +71,22 @@
|
||||
// CHECK-FP-NONLEAF: "-mframe-pointer=non-leaf"
|
||||
// CHECK-FP-NONE: "-mframe-pointer=none"
|
||||
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia -rtlib=libgcc -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia -rtlib=libgcc 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-RTLIB
|
||||
// CHECK-RTLIB: error: invalid runtime library name in argument '-rtlib=libgcc'
|
||||
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia -static -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia -static -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-STATIC
|
||||
// CHECK-STATIC: "-Bstatic"
|
||||
// CHECK-STATIC: "-Bdynamic"
|
||||
// CHECK-STATIC: "-lc"
|
||||
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia -shared -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia -shared -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-SHARED
|
||||
// CHECK-SHARED-NOT: "-pie"
|
||||
// CHECK-SHARED: "-shared"
|
||||
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia -r -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia -r -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-RELOCATABLE
|
||||
// CHECK-RELOCATABLE-NOT: "-pie"
|
||||
// CHECK-RELOCATABLE-NOT: "--build-id"
|
||||
@@ -95,21 +95,21 @@
|
||||
// CHECK-RELOCATABLE-NOT: "-l
|
||||
// CHECK-RELOCATABLE-NOT: crt{{[^./\\]+}}.o
|
||||
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia -nodefaultlibs -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia -nodefaultlibs -fuse-ld=ld 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-NODEFAULTLIBS
|
||||
// CHECK-NODEFAULTLIBS: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-NODEFAULTLIBS-NOT: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-fuchsia{{/|\\\\}}libclang_rt.builtins.a"
|
||||
// CHECK-NODEFAULTLIBS-NOT: "-lc"
|
||||
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia -nostdlib -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia -nostdlib -fuse-ld=ld 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-NOSTDLIB
|
||||
// CHECK-NOSTDLIB: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-NOSTDLIB-NOT: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-fuchsia{{/|\\\\}}libclang_rt.builtins.a"
|
||||
// CHECK-NOSTDLIB-NOT: "-lc"
|
||||
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia -nolibc -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia -nolibc -fuse-ld=ld 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-NOLIBC
|
||||
// CHECK-NOLIBC: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
@@ -119,7 +119,7 @@
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
|
||||
// RUN: -fsanitize=safe-stack 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-SAFESTACK
|
||||
// CHECK-SAFESTACK: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-SAFESTACK: "-fsanitize=safe-stack"
|
||||
@@ -129,7 +129,7 @@
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
|
||||
// RUN: -fsanitize=address 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-ASAN-X86
|
||||
// CHECK-ASAN-X86: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-ASAN-X86: "-fsanitize=address"
|
||||
@@ -141,7 +141,7 @@
|
||||
// RUN: %clang -### %s --target=aarch64-unknown-fuchsia \
|
||||
// RUN: -fsanitize=address 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-ASAN-AARCH64
|
||||
// CHECK-ASAN-AARCH64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-ASAN-AARCH64: "-fsanitize=address,shadow-call-stack"
|
||||
@@ -153,7 +153,7 @@
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
|
||||
// RUN: -fsanitize=address -fPIC -shared 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-ASAN-SHARED
|
||||
// CHECK-ASAN-SHARED: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-ASAN-SHARED: "-fsanitize=address"
|
||||
@@ -164,7 +164,7 @@
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
|
||||
// RUN: -fsanitize=fuzzer 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-FUZZER-X86
|
||||
// CHECK-FUZZER-X86: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-FUZZER-X86: "-fsanitize=fuzzer,fuzzer-no-link,safe-stack"
|
||||
@@ -173,7 +173,7 @@
|
||||
// RUN: %clang -### %s --target=aarch64-unknown-fuchsia \
|
||||
// RUN: -fsanitize=fuzzer 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-FUZZER-AARCH64
|
||||
// CHECK-FUZZER-AARCH64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-FUZZER-AARCH64: "-fsanitize=fuzzer,fuzzer-no-link,shadow-call-stack"
|
||||
@@ -182,7 +182,7 @@
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
|
||||
// RUN: -fsanitize=scudo 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-SCUDO-X86
|
||||
// CHECK-SCUDO-X86: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-SCUDO-X86: "-fsanitize=safe-stack,scudo"
|
||||
@@ -192,7 +192,7 @@
|
||||
// RUN: %clang -### %s --target=aarch64-unknown-fuchsia \
|
||||
// RUN: -fsanitize=scudo 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-SCUDO-AARCH64
|
||||
// CHECK-SCUDO-AARCH64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-SCUDO-AARCH64: "-fsanitize=shadow-call-stack,scudo"
|
||||
@@ -202,7 +202,7 @@
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
|
||||
// RUN: -fsanitize=scudo -fPIC -shared 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-SCUDO-SHARED
|
||||
// CHECK-SCUDO-SHARED: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-SCUDO-SHARED: "-fsanitize=safe-stack,scudo"
|
||||
@@ -211,7 +211,7 @@
|
||||
// RUN: %clang -### %s --target=aarch64-unknown-fuchsia \
|
||||
// RUN: -fsanitize=leak 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-LSAN-AARCH64
|
||||
// CHECK-LSAN-AARCH64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-LSAN-AARCH64: "-fsanitize=leak,shadow-call-stack"
|
||||
@@ -221,7 +221,7 @@
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
|
||||
// RUN: -fsanitize=leak 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-LSAN-X86
|
||||
// CHECK-LSAN-X86: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-LSAN-X86: "-fsanitize=leak,safe-stack"
|
||||
@@ -231,7 +231,7 @@
|
||||
// RUN: %clang -### %s --target=aarch64-unknown-fuchsia \
|
||||
// RUN: -fsanitize=leak -fPIC -shared 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-LSAN-SHARED
|
||||
// CHECK-LSAN-SHARED: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-LSAN-SHARED: "-fsanitize=leak,shadow-call-stack"
|
||||
@@ -240,7 +240,7 @@
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
|
||||
// RUN: -fxray-instrument -fxray-modes=xray-basic \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld 2>&1 \
|
||||
// RUN: -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-XRAY-X86
|
||||
// CHECK-XRAY-X86: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-XRAY-X86: "-fxray-instrument"
|
||||
@@ -250,7 +250,7 @@
|
||||
// RUN: %clang -### %s --target=aarch64-unknown-fuchsia \
|
||||
// RUN: -fxray-instrument -fxray-modes=xray-basic \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld 2>&1 \
|
||||
// RUN: -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-XRAY-AARCH64
|
||||
// CHECK-XRAY-AARCH64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-XRAY-AARCH64: "-fxray-instrument"
|
||||
@@ -259,14 +259,14 @@
|
||||
|
||||
// RUN: %clang -### %s --target=aarch64-unknown-fuchsia \
|
||||
// RUN: -O3 -flto -mcpu=cortex-a53 2>&1 \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-LTO
|
||||
// CHECK-LTO: "-plugin-opt=mcpu=cortex-a53"
|
||||
// CHECK-LTO: "-plugin-opt=O3"
|
||||
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
|
||||
// RUN: -flto=thin -flto-jobs=8 2>&1 \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-THINLTO
|
||||
// CHECK-THINLTO: "-plugin-opt=mcpu=x86-64"
|
||||
// CHECK-THINLTO: "-plugin-opt=thinlto"
|
||||
@@ -280,7 +280,7 @@
|
||||
// RUN: %clang -### %s --target=aarch64-unknown-fuchsia \
|
||||
// RUN: -fprofile-instr-generate -fcoverage-mapping \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld 2>&1 \
|
||||
// RUN: -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-PROFRT-AARCH64
|
||||
// CHECK-PROFRT-AARCH64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-PROFRT-AARCH64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}aarch64-unknown-fuchsia{{/|\\\\}}libclang_rt.profile.a"
|
||||
@@ -288,7 +288,7 @@
|
||||
// RUN: %clang -### %s --target=x86_64-unknown-fuchsia \
|
||||
// RUN: -fprofile-instr-generate -fcoverage-mapping \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld 2>&1 \
|
||||
// RUN: -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-PROFRT-X86_64
|
||||
// CHECK-PROFRT-X86_64: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-PROFRT-X86_64: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-fuchsia{{/|\\\\}}libclang_rt.profile.a"
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
// RUN: %clangxx -### %s --target=x86_64-unknown-fuchsia \
|
||||
// RUN: -ccc-install-dir %S/Inputs/basic_fuchsia_tree/bin \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=lld 2>&1 \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck -check-prefixes=CHECK,CHECK-X86_64 %s
|
||||
// RUN: %clangxx -### %s --target=aarch64-unknown-fuchsia \
|
||||
// RUN: -ccc-install-dir %S/Inputs/basic_fuchsia_tree/bin \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=lld 2>&1 \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck -check-prefixes=CHECK,CHECK-AARCH64 %s
|
||||
// RUN: %clangxx -### %s --target=riscv64-unknown-fuchsia \
|
||||
// RUN: -ccc-install-dir %S/Inputs/basic_fuchsia_tree/bin \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=lld 2>&1 \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck -check-prefixes=CHECK,CHECK-RISCV64 %s
|
||||
// RUN: %clangxx -### %s --target=x86_64-fuchsia \
|
||||
// RUN: -ccc-install-dir %S/Inputs/basic_fuchsia_tree/bin \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=lld 2>&1 \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck -check-prefixes=CHECK,CHECK-X86_64 %s
|
||||
// RUN: %clangxx -### %s --target=aarch64-fuchsia \
|
||||
// RUN: -ccc-install-dir %S/Inputs/basic_fuchsia_tree/bin \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=lld 2>&1 \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck -check-prefixes=CHECK,CHECK-AARCH64 %s
|
||||
// RUN: %clangxx -### %s --target=riscv64-fuchsia \
|
||||
// RUN: -ccc-install-dir %S/Inputs/basic_fuchsia_tree/bin \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=lld 2>&1 \
|
||||
// RUN: --sysroot=%S/platform -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck -check-prefixes=CHECK,CHECK-RISCV64 %s
|
||||
// CHECK: "-cc1"
|
||||
// CHECK-X86_64: "-triple" "x86_64-unknown-fuchsia"
|
||||
@@ -61,13 +61,12 @@
|
||||
// CHECK-NOT: crtend.o
|
||||
// CHECK-NOT: crtn.o
|
||||
|
||||
// RUN: %clangxx -### %s --target=x86_64-unknown-fuchsia -stdlib=libstdc++ \
|
||||
// RUN: -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clangxx -### %s --target=x86_64-unknown-fuchsia -stdlib=libstdc++ 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-STDLIB
|
||||
// CHECK-STDLIB: error: invalid library name in argument '-stdlib=libstdc++'
|
||||
|
||||
// RUN: %clangxx -### %s --target=x86_64-unknown-fuchsia -static-libstdc++ \
|
||||
// RUN: -fuse-ld=lld 2>&1 \
|
||||
// RUN: -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-STATIC
|
||||
// CHECK-STATIC: "--push-state"
|
||||
// CHECK-STATIC: "--as-needed"
|
||||
@@ -78,7 +77,7 @@
|
||||
// CHECK-STATIC: "--pop-state"
|
||||
// CHECK-STATIC: "-lc"
|
||||
|
||||
// RUN: %clangxx -### %s --target=x86_64-unknown-fuchsia -nostdlib++ -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clangxx -### %s --target=x86_64-unknown-fuchsia -nostdlib++ -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-NOSTDLIBXX
|
||||
// CHECK-NOSTDLIBXX-NOT: "-lc++"
|
||||
// CHECK-NOSTDLIBXX-NOT: "-lm"
|
||||
@@ -87,49 +86,49 @@
|
||||
// RUN: %clangxx -### %s --target=x86_64-unknown-fuchsia \
|
||||
// RUN: -ccc-install-dir %S/Inputs/basic_fuchsia_tree/bin \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld 2>&1\
|
||||
// RUN: -fuse-ld=ld 2>&1\
|
||||
// RUN: | FileCheck %s -check-prefixes=CHECK-MULTILIB-X86
|
||||
// RUN: %clangxx -### %s --target=x86_64-unknown-fuchsia -fsanitize=address \
|
||||
// RUN: -ccc-install-dir %S/Inputs/basic_fuchsia_tree/bin \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld 2>&1\
|
||||
// RUN: -fuse-ld=ld 2>&1\
|
||||
// RUN: | FileCheck %s -check-prefixes=CHECK-MULTILIB-X86,CHECK-MULTILIB-ASAN-X86
|
||||
// RUN: %clangxx -### %s --target=x86_64-unknown-fuchsia -fno-exceptions \
|
||||
// RUN: -ccc-install-dir %S/Inputs/basic_fuchsia_tree/bin \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld 2>&1\
|
||||
// RUN: -fuse-ld=ld 2>&1\
|
||||
// RUN: | FileCheck %s -check-prefixes=CHECK-MULTILIB-X86,CHECK-MULTILIB-NOEXCEPT-X86
|
||||
// RUN: %clangxx -### %s --target=x86_64-unknown-fuchsia -fsanitize=address -fno-exceptions \
|
||||
// RUN: -ccc-install-dir %S/Inputs/basic_fuchsia_tree/bin \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld 2>&1\
|
||||
// RUN: -fuse-ld=ld 2>&1\
|
||||
// RUN: | FileCheck %s -check-prefixes=CHECK-MULTILIB-X86,CHECK-MULTILIB-ASAN-NOEXCEPT-X86
|
||||
// RUN: %clangxx -### %s --target=x86_64-unknown-fuchsia -fsanitize=hwaddress \
|
||||
// RUN: -ccc-install-dir %S/Inputs/basic_fuchsia_tree/bin \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld 2>&1\
|
||||
// RUN: -fuse-ld=ld 2>&1\
|
||||
// RUN: | FileCheck %s -check-prefixes=CHECK-MULTILIB-X86,CHECK-MULTILIB-HWASAN-X86
|
||||
// RUN: %clangxx -### %s --target=x86_64-unknown-fuchsia -fsanitize=hwaddress -fno-exceptions \
|
||||
// RUN: -ccc-install-dir %S/Inputs/basic_fuchsia_tree/bin \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld 2>&1\
|
||||
// RUN: -fuse-ld=ld 2>&1\
|
||||
// RUN: | FileCheck %s -check-prefixes=CHECK-MULTILIB-X86,CHECK-MULTILIB-HWASAN-NOEXCEPT-X86
|
||||
|
||||
// Test compat multilibs.
|
||||
// RUN: %clangxx -### %s --target=x86_64-unknown-fuchsia -fc++-abi=itanium \
|
||||
// RUN: -ccc-install-dir %S/Inputs/basic_fuchsia_tree/bin \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld 2>&1\
|
||||
// RUN: -fuse-ld=ld 2>&1\
|
||||
// RUN: | FileCheck %s -check-prefixes=CHECK-MULTILIB-X86,CHECK-MULTILIB-COMPAT-X86
|
||||
// RUN: %clangxx -### %s --target=x86_64-unknown-fuchsia -fc++-abi=itanium -fc++-abi=fuchsia \
|
||||
// RUN: -ccc-install-dir %S/Inputs/basic_fuchsia_tree/bin \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld 2>&1\
|
||||
// RUN: -fuse-ld=ld 2>&1\
|
||||
// RUN: | FileCheck %s -check-prefixes=CHECK-MULTILIB-X86
|
||||
// RUN: %clangxx -### %s --target=x86_64-unknown-fuchsia -fc++-abi=fuchsia -fc++-abi=itanium \
|
||||
// RUN: -ccc-install-dir %S/Inputs/basic_fuchsia_tree/bin \
|
||||
// RUN: -resource-dir=%S/Inputs/resource_dir_with_per_target_subdir \
|
||||
// RUN: -fuse-ld=lld 2>&1\
|
||||
// RUN: -fuse-ld=ld 2>&1\
|
||||
// RUN: | FileCheck %s -check-prefixes=CHECK-MULTILIB-X86,CHECK-MULTILIB-COMPAT-X86
|
||||
// CHECK-MULTILIB-X86: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-MULTILIB-ASAN-X86: "-L{{.*}}{{/|\\\\}}..{{/|\\\\}}lib{{/|\\\\}}x86_64-unknown-fuchsia{{/|\\\\}}asan"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// RUN: --hip-device-lib=lib1.bc --hip-device-lib=lib2.bc \
|
||||
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
|
||||
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib2 \
|
||||
// RUN: -fuse-ld=lld -nogpuinc \
|
||||
// RUN: -fuse-ld=lld -B%S/Inputs/lld -nogpuinc \
|
||||
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
|
||||
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
|
||||
// RUN: 2>&1 | FileCheck -check-prefixes=CHECK,LINK %s
|
||||
@@ -17,7 +17,7 @@
|
||||
// RUN: --hip-device-lib=lib1.bc --hip-device-lib=lib2.bc \
|
||||
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
|
||||
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib2 \
|
||||
// RUN: -fuse-ld=lld -nogpuinc -c \
|
||||
// RUN: -fuse-ld=lld -B%S/Inputs/lld -nogpuinc -c \
|
||||
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
|
||||
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
|
||||
// RUN: 2>&1 | FileCheck -check-prefixes=CHECK %s
|
||||
@@ -27,7 +27,7 @@
|
||||
// RUN: --hip-device-lib=lib1.bc --hip-device-lib=lib2.bc \
|
||||
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
|
||||
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib2 \
|
||||
// RUN: -fuse-ld=lld -nogpuinc --offload-new-driver -c \
|
||||
// RUN: -fuse-ld=lld -B%S/Inputs/lld -nogpuinc --offload-new-driver -c \
|
||||
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
|
||||
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
|
||||
// RUN: 2>&1 | FileCheck -check-prefixes=CHECK %s
|
||||
@@ -35,7 +35,7 @@
|
||||
// RUN: touch %t/a.o %t/b.o
|
||||
// RUN: %clang -### --target=x86_64-linux-gnu \
|
||||
// RUN: --hip-link --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
|
||||
// RUN: -fuse-ld=lld -nogpuinc \
|
||||
// RUN: -fuse-ld=lld -B%S/Inputs/lld -nogpuinc \
|
||||
// RUN: %t/a.o %t/b.o \
|
||||
// RUN: 2>&1 | FileCheck -check-prefixes=LKONLY %s
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// RUN: --hip-device-lib=lib1.bc --hip-device-lib=lib2.bc \
|
||||
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
|
||||
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib2 \
|
||||
// RUN: -fuse-ld=lld -fgpu-rdc -nogpuinc \
|
||||
// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
|
||||
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
|
||||
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
|
||||
// RUN: 2>&1 | FileCheck %s
|
||||
@@ -85,19 +85,19 @@
|
||||
// RUN: touch %t/a.o %t/b.o
|
||||
// RUN: %clang --hip-link -### --target=x86_64-linux-gnu \
|
||||
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
|
||||
// RUN: -fuse-ld=lld -fgpu-rdc -nogpuinc \
|
||||
// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
|
||||
// RUN: %t/a.o %t/b.o \
|
||||
// RUN: 2>&1 | FileCheck -check-prefixes=LINK,LINK-HOST-UNBUNDLE,LLD-TMP,LINK-BUNDLE,LINK-EMBED %s
|
||||
|
||||
// RUN: %clang --hip-link -### --target=x86_64-linux-gnu \
|
||||
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
|
||||
// RUN: -fuse-ld=lld -fgpu-rdc -nogpuinc \
|
||||
// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
|
||||
// RUN: %t/a.o %t/b.o --cuda-device-only \
|
||||
// RUN: 2>&1 | FileCheck -check-prefixes=LINK,LLD-TMP,LINK-BUNDLE,LINK-NOEMBED %s
|
||||
|
||||
// RUN: %clang --hip-link -### --target=x86_64-linux-gnu \
|
||||
// RUN: --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
|
||||
// RUN: -fuse-ld=lld -fgpu-rdc -nogpuinc \
|
||||
// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
|
||||
// RUN: %t/a.o %t/b.o --cuda-device-only --no-gpu-bundle-output \
|
||||
// RUN: 2>&1 | FileCheck -check-prefixes=LINK,LLD-FIN,LINK-NOBUNDLE,LINK-NOEMBED %s
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// RUN: %clang -### --target=x86_64-linux-gnu \
|
||||
// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \
|
||||
// RUN: --emit-static-lib -nogpulib \
|
||||
// RUN: -fuse-ld=lld -fgpu-rdc -nogpuinc \
|
||||
// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
|
||||
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
|
||||
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
|
||||
// RUN: 2>&1 | FileCheck %s
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// RUN: --hip-device-lib=lib1.bc --hip-device-lib=lib2.bc \
|
||||
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
|
||||
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib2 \
|
||||
// RUN: -fuse-ld=lld -fgpu-rdc -nogpuinc \
|
||||
// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
|
||||
// RUN: -fhip-dump-offload-linker-script \
|
||||
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
|
||||
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
|
||||
@@ -17,7 +17,7 @@
|
||||
// RUN: --hip-device-lib=lib1.bc --hip-device-lib=lib2.bc \
|
||||
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib1 \
|
||||
// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/lib2 \
|
||||
// RUN: -fuse-ld=lld -fgpu-rdc -nogpuinc \
|
||||
// RUN: -fuse-ld=lld -B%S/Inputs/lld -fgpu-rdc -nogpuinc \
|
||||
// RUN: -fhip-dump-offload-linker-script \
|
||||
// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
|
||||
// RUN: %S/Inputs/hip_multiple_inputs/b.hip \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// The default linker doesn't support LLVM bitcode
|
||||
// RUN: not %clang --target=i686-pc-windows-gnu %s -flto -fuse-ld=bfd
|
||||
// When using lld, this is allowed though.
|
||||
// RUN: %clang --target=i686-pc-windows-gnu -### %s -flto -fuse-ld=lld
|
||||
// RUN: %clang --target=i686-pc-windows-gnu -### %s -flto -fuse-ld=lld -B%S/Inputs/lld
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// RUN: %clang %s -### -no-canonical-prefixes --target=arm-liteos \
|
||||
// RUN: -resource-dir=%S/Inputs/ohos_native_tree/llvm/lib/clang/x.y.z \
|
||||
// RUN: --sysroot=%S/Inputs/ohos_native_tree/sysroot -fuse-ld=lld -march=armv7-a 2>&1 \
|
||||
// RUN: --sysroot=%S/Inputs/ohos_native_tree/sysroot -fuse-ld=ld -march=armv7-a 2>&1 \
|
||||
// RUN: | FileCheck -check-prefixes=CHECK,CHECK-ARM %s
|
||||
// RUN: %clang %s -### -no-canonical-prefixes --target=arm-liteos \
|
||||
// RUN: -resource-dir=%S/Inputs/ohos_native_tree/llvm/lib/clang/x.y.z \
|
||||
// RUN: --sysroot=%S/Inputs/ohos_native_tree/sysroot -fuse-ld=lld -march=armv7-a -mcpu=cortex-a7 -mfloat-abi=soft 2>&1 \
|
||||
// RUN: --sysroot=%S/Inputs/ohos_native_tree/sysroot -fuse-ld=ld -march=armv7-a -mcpu=cortex-a7 -mfloat-abi=soft 2>&1 \
|
||||
// RUN: | FileCheck -check-prefixes=CHECK,CHECK-ARM-A7-SOFT %s
|
||||
// CHECK: {{.*}}clang{{.*}}" "-cc1"
|
||||
// CHECK-NOT: "--mrelax-relocations"
|
||||
@@ -32,56 +32,56 @@
|
||||
// CHECK: clang_rt.crtend.o
|
||||
// CHECK: crtn.o
|
||||
|
||||
// RUN: %clang %s -### --target=arm-liteos -rtlib=libgcc -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clang %s -### --target=arm-liteos -rtlib=libgcc 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-RTLIB
|
||||
// CHECK-RTLIB: error: invalid runtime library name in argument '-rtlib=libgcc'
|
||||
|
||||
// RUN: %clang %s -### --target=arm-liteos -static -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clang %s -### --target=arm-liteos -static -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-STATIC
|
||||
// CHECK-STATIC: "-static"
|
||||
// CHECK-STATIC-NOT: "-Bdynamic"
|
||||
// CHECK-STATIC: "-l:libunwind.a"
|
||||
// CHECK-STATIC: "-lc"
|
||||
|
||||
// RUN: %clang %s -### --target=arm-liteos -shared -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clang %s -### --target=arm-liteos -shared -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-SHARED
|
||||
// CHECK-SHARED-NOT: "-pie"
|
||||
// CHECK-SHARED: "-shared"
|
||||
// CHECK-SHARED: "-lc"
|
||||
// CHECK-SHARED: "-l:libunwind.a"
|
||||
|
||||
// RUN: %clang %s -### --target=arm-linux-ohos -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clang %s -### --target=arm-linux-ohos -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-RUNTIME
|
||||
// RUN: %clang %s -### --target=aarch64-linux-ohos -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clang %s -### --target=aarch64-linux-ohos -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-RUNTIME
|
||||
// RUN: %clang %s -### --target=mipsel-linux-ohos -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clang %s -### --target=mipsel-linux-ohos -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-RUNTIME
|
||||
// RUN: %clang %s -### --target=x86_64-linux-ohos -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clang %s -### --target=x86_64-linux-ohos -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-RUNTIME
|
||||
// CHECK-RUNTIME: "{{.*}}libclang_rt.builtins.a"
|
||||
// CHECK-RUNTIME: "-l:libunwind.a"
|
||||
// CHECK-LIBM: "-lm"
|
||||
|
||||
// RUN: %clang %s -### --target=arm-liteos -r -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clang %s -### --target=arm-liteos -r -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-RELOCATABLE
|
||||
// CHECK-RELOCATABLE-NOT: "-pie"
|
||||
// CHECK-RELOCATABLE: "-r"
|
||||
|
||||
// RUN: %clang %s -### --target=arm-liteos -nodefaultlibs -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clang %s -### --target=arm-liteos -nodefaultlibs -fuse-ld=ld 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/ohos_native_tree/llvm/lib/clang/x.y.z \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-NODEFAULTLIBS
|
||||
// CHECK-NODEFAULTLIBS: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-NODEFAULTLIBS-NOT: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}arm-liteos-ohos{{/|\\\\}}libclang_rt.builtins.a"
|
||||
// CHECK-NODEFAULTLIBS-NOT: "-lc"
|
||||
|
||||
// RUN: %clang %s -### --target=arm-liteos -nostdlib -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clang %s -### --target=arm-liteos -nostdlib -fuse-ld=ld 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/ohos_native_tree/llvm/lib/clang/x.y.z \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-NOSTDLIB
|
||||
// CHECK-NOSTDLIB: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-NOSTDLIB-NOT: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}arm-liteos-ohos{{/|\\\\}}libclang_rt.builtins.a"
|
||||
// CHECK-NOSTDLIB-NOT: "-lc"
|
||||
|
||||
// RUN: %clang %s -### --target=arm-liteos -nolibc -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clang %s -### --target=arm-liteos -nolibc -fuse-ld=ld 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/ohos_native_tree/llvm/lib/clang/x.y.z \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-NOLIBC
|
||||
// CHECK-NOLIBC: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
@@ -91,7 +91,7 @@
|
||||
// RUN: %clang %s -### --target=arm-liteos \
|
||||
// RUN: -fsanitize=safe-stack 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/ohos_native_tree/llvm/lib/clang/x.y.z \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-SAFESTACK
|
||||
// CHECK-SAFESTACK: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-SAFESTACK: "-fsanitize=safe-stack"
|
||||
@@ -101,7 +101,7 @@
|
||||
// RUN: %clang %s -### --target=arm-liteos \
|
||||
// RUN: -fsanitize=address 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/ohos_native_tree/llvm/lib/clang/x.y.z \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-ASAN-ARM
|
||||
// CHECK-ASAN-ARM: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-ASAN-ARM: "-fsanitize=address"
|
||||
@@ -114,7 +114,7 @@
|
||||
// RUN: -fsanitize=address -fPIC -shared 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/ohos_native_tree/llvm/lib/clang/x.y.z \
|
||||
// RUN: -shared-libsan \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-ASAN-SHARED
|
||||
// CHECK-ASAN-SHARED: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-ASAN-SHARED: "-fsanitize=address"
|
||||
@@ -125,7 +125,7 @@
|
||||
// RUN: %clang %s -### --target=arm-liteos \
|
||||
// RUN: -fsanitize=fuzzer 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/ohos_native_tree/llvm/lib/clang/x.y.z \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-FUZZER-ARM
|
||||
// CHECK-FUZZER-ARM: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-FUZZER-ARM: "-fsanitize=fuzzer,fuzzer-no-link"
|
||||
@@ -134,7 +134,7 @@
|
||||
// RUN: %clang %s -### --target=arm-liteos \
|
||||
// RUN: -fsanitize=scudo 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/ohos_native_tree/llvm/lib/clang/x.y.z \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-SCUDO-ARM
|
||||
// CHECK-SCUDO-ARM: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-SCUDO-ARM: "-fsanitize=scudo"
|
||||
@@ -145,7 +145,7 @@
|
||||
// RUN: -fsanitize=scudo -fPIC -shared 2>&1 \
|
||||
// RUN: -resource-dir=%S/Inputs/ohos_native_tree/llvm/lib/clang/x.y.z \
|
||||
// RUN: -shared-libsan \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-SCUDO-SHARED
|
||||
// CHECK-SCUDO-SHARED: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-SCUDO-SHARED: "-fsanitize=scudo"
|
||||
@@ -154,7 +154,7 @@
|
||||
// RUN: %clang %s -### --target=arm-liteos \
|
||||
// RUN: -fxray-instrument -fxray-modes=xray-basic \
|
||||
// RUN: -resource-dir=%S/Inputs/ohos_native_tree/llvm/lib/clang/x.y.z \
|
||||
// RUN: -fuse-ld=lld 2>&1 \
|
||||
// RUN: -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-XRAY-ARM
|
||||
// CHECK-XRAY-ARM: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
|
||||
// CHECK-XRAY-ARM: "-fxray-instrument"
|
||||
@@ -163,14 +163,14 @@
|
||||
|
||||
// RUN: %clang %s -### --target=arm-liteos \
|
||||
// RUN: -O3 -flto -mcpu=cortex-a53 2>&1 \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-LTO
|
||||
// CHECK-LTO: "-plugin-opt=mcpu=cortex-a53"
|
||||
// CHECK-LTO: "-plugin-opt=O3"
|
||||
|
||||
// RUN: %clang %s -### --target=arm-liteos \
|
||||
// RUN: -flto=thin -flto-jobs=8 -mcpu=cortex-a7 2>&1 \
|
||||
// RUN: -fuse-ld=lld \
|
||||
// RUN: -fuse-ld=ld \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-THINLTO
|
||||
// CHECK-THINLTO: "-plugin-opt=mcpu=cortex-a7"
|
||||
// CHECK-THINLTO: "-plugin-opt=thinlto"
|
||||
@@ -222,7 +222,7 @@
|
||||
|
||||
// RUN: %clang %s -### -no-canonical-prefixes --target=arm-linux-ohos -fprofile-instr-generate -v \
|
||||
// RUN: -resource-dir=%S/Inputs/ohos_native_tree/llvm/lib/clang/x.y.z \
|
||||
// RUN: --sysroot=%S/Inputs/ohos_native_tree/sysroot -fuse-ld=lld -march=armv7-a 2>&1 \
|
||||
// RUN: --sysroot=%S/Inputs/ohos_native_tree/sysroot -fuse-ld=ld -march=armv7-a 2>&1 \
|
||||
// RUN: | FileCheck -check-prefixes=CHECK-PROFILE-RTLIB %s
|
||||
|
||||
// CHECK-PROFILE-RTLIB: -u__llvm_profile_runtime
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// RUN: %clangxx %s -### -no-canonical-prefixes --target=arm-liteos -march=armv7-a \
|
||||
// RUN: -ccc-install-dir %S/Inputs/ohos_native_tree/llvm/bin \
|
||||
// RUN: -resource-dir=%S/Inputs/ohos_native_tree/llvm/lib/clang/x.y.z \
|
||||
// RUN: --sysroot=%S/Inputs/ohos_native_tree/sysroot -fuse-ld=lld 2>&1 | FileCheck %s
|
||||
// RUN: --sysroot=%S/Inputs/ohos_native_tree/sysroot -fuse-ld=ld 2>&1 | FileCheck %s
|
||||
// CHECK: {{.*}}clang{{.*}}" "-cc1"
|
||||
// CHECK: "-triple" "armv7-unknown-liteos-ohos"
|
||||
// CHECK-NOT: "-fuse-init-array"
|
||||
@@ -25,13 +25,12 @@
|
||||
// CHECK: clang_rt.crtend.o
|
||||
// CHECK: crtn.o
|
||||
|
||||
// RUN: %clangxx %s -### --target=arm-unknown-liteos -stdlib=libstdc++ \
|
||||
// RUN: -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clangxx %s -### --target=arm-unknown-liteos -stdlib=libstdc++ 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-STDLIB
|
||||
// CHECK-STDLIB: error: invalid library name in argument '-stdlib=libstdc++'
|
||||
|
||||
// RUN: %clangxx %s -### --target=arm-unknown-liteos -static-libstdc++ \
|
||||
// RUN: -fuse-ld=lld 2>&1 \
|
||||
// RUN: -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-STATIC
|
||||
// CHECK-STATIC-NOT: "--push-state"
|
||||
// CHECK-STATIC-NOT: "--as-needed"
|
||||
@@ -43,7 +42,7 @@
|
||||
// CHECK-STATIC: "-lc"
|
||||
|
||||
// RUN: %clangxx %s -### --target=arm-unknown-liteos -static \
|
||||
// RUN: -fuse-ld=lld 2>&1 \
|
||||
// RUN: -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-STATIC1
|
||||
// CHECK-STATIC1-NOT: "-fuse-init-array"
|
||||
// CHECK-STATIC1: "-static"
|
||||
@@ -54,7 +53,7 @@
|
||||
// CHECK-STATIC1: "-lc"
|
||||
|
||||
// RUN: %clangxx %s -### --target=arm-unknown-liteos -march=armv7-a -mfloat-abi=soft -static -fPIE -fPIC -fpic -pie \
|
||||
// RUN: --sysroot=%S/Inputs/ohos_native_tree/sysroot -fuse-ld=lld 2>&1 \
|
||||
// RUN: --sysroot=%S/Inputs/ohos_native_tree/sysroot -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-STATIC2
|
||||
// CHECK-STATIC2: "-isysroot" "[[SYSROOT:[^"]+]]"
|
||||
// CHECK-STATIC2: {{.*}}ld.lld{{.*}}" "--sysroot=[[SYSROOT]]"
|
||||
@@ -65,7 +64,7 @@
|
||||
// CHECK-STATIC2: "-lm"
|
||||
// CHECK-STATIC2: "-lc"
|
||||
|
||||
// RUN: %clangxx %s -### --target=arm-liteos -nostdlib++ -fuse-ld=lld 2>&1 \
|
||||
// RUN: %clangxx %s -### --target=arm-liteos -nostdlib++ -fuse-ld=ld 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-NOSTDLIBXX
|
||||
// CHECK-NOSTDLIBXX-NOT: "-lc++"
|
||||
// CHECK-NOSTDLIBXX: "-lm"
|
||||
|
||||
@@ -44,14 +44,14 @@
|
||||
|
||||
// Test remarks options pass-through
|
||||
// No pass-through: lto is disabled
|
||||
// RUN: %clang -target x86_64 -### -o FOO -fdiagnostics-hotness-threshold=100 -fsave-optimization-record %s 2>&1 | FileCheck %s -check-prefix=CHECK-NOPASS
|
||||
// RUN: %clang --target=x86_64 -### -o FOO -fdiagnostics-hotness-threshold=100 -fsave-optimization-record %s 2>&1 | FileCheck %s -check-prefix=CHECK-NOPASS
|
||||
|
||||
// Pass-through:
|
||||
// RUN: %clang -target x86_64-linux -### -fuse-ld=lld -flto -fdiagnostics-hotness-threshold=100 -fsave-optimization-record -foptimization-record-passes=inline %s 2>&1 | FileCheck %s -check-prefix=CHECK-PASS-A
|
||||
// RUN: %clang -target x86_64-linux -### -o FOO -fuse-ld=gold -flto -fdiagnostics-hotness-threshold=100 -fsave-optimization-record -foptimization-record-passes=inline %s 2>&1 | FileCheck %s -check-prefix=CHECK-PASS
|
||||
// RUN: %clang -target x86_64-linux -### -o FOO -fuse-ld=lld -flto=thin -fdiagnostics-hotness-threshold=100 -fsave-optimization-record=some-format -foptimization-record-file=FOO.txt %s 2>&1 | FileCheck %s -check-prefix=CHECK-PASS-CUSTOM
|
||||
// RUN: %clang -target x86_64-linux -### -o FOO -fuse-ld=lld -flto=thin -fdiagnostics-hotness-threshold=100 -Rpass=inline -Rpass-missed=inline -Rpass-analysis=inline %s 2>&1 | FileCheck %s -check-prefix=CHECK-PASS-RPASS
|
||||
// RUN: %clang -target x86_64-linux -### -o FOO -fuse-ld=lld -flto=thin -fdiagnostics-hotness-threshold=auto -Rpass=inline -Rpass-missed=inline -Rpass-analysis=inline %s 2>&1 | FileCheck %s -check-prefix=CHECK-PASS-AUTO
|
||||
// RUN: %clang --target=x86_64-linux -### -fuse-ld=lld -B%S/Inputs/lld -flto -fdiagnostics-hotness-threshold=100 -fsave-optimization-record -foptimization-record-passes=inline %s 2>&1 | FileCheck %s -check-prefix=CHECK-PASS-A
|
||||
// RUN: %clang --target=x86_64-linux -### -o FOO -fuse-ld=gold -flto -fdiagnostics-hotness-threshold=100 -fsave-optimization-record -foptimization-record-passes=inline %s 2>&1 | FileCheck %s -check-prefix=CHECK-PASS
|
||||
// RUN: %clang --target=x86_64-linux -### -o FOO -fuse-ld=lld -B%S/Inputs/lld -flto=thin -fdiagnostics-hotness-threshold=100 -fsave-optimization-record=some-format -foptimization-record-file=FOO.txt %s 2>&1 | FileCheck %s -check-prefix=CHECK-PASS-CUSTOM
|
||||
// RUN: %clang --target=x86_64-linux -### -o FOO -fuse-ld=lld -B%S/Inputs/lld -flto=thin -fdiagnostics-hotness-threshold=100 -Rpass=inline -Rpass-missed=inline -Rpass-analysis=inline %s 2>&1 | FileCheck %s -check-prefix=CHECK-PASS-RPASS
|
||||
// RUN: %clang --target=x86_64-linux -### -o FOO -fuse-ld=lld -B%S/Inputs/lld -flto=thin -fdiagnostics-hotness-threshold=auto -Rpass=inline -Rpass-missed=inline -Rpass-analysis=inline %s 2>&1 | FileCheck %s -check-prefix=CHECK-PASS-AUTO
|
||||
|
||||
// CHECK-NOPASS-NOT: "-plugin-opt=opt-remarks-filename="
|
||||
// CHECK-NOPASS-NOT: "-plugin-opt=opt-remarks-passes=inline"
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
|
||||
// Test interaction with -fuse-ld=lld, if lld is available.
|
||||
// RUN: %clang -### %s --target=riscv32 \
|
||||
// RUN: --gcc-toolchain=%S/Inputs/basic_riscv32_tree -fuse-ld=lld 2>&1 \
|
||||
// RUN: --gcc-toolchain=%S/Inputs/basic_riscv32_tree -fuse-ld=lld -B%S/Inputs/lld 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=LLD %s
|
||||
// LLD: {{(error: invalid linker name in argument '-fuse-ld=lld')|(ld.lld)}}
|
||||
// LLD: ld.lld
|
||||
|
||||
// In the below tests, --rtlib=platform is used so that the driver ignores
|
||||
// the configure-time CLANG_DEFAULT_RTLIB option when choosing the runtime lib
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
// CC1: "-cc1" "-triple" "riscv64"
|
||||
|
||||
// Test interaction with -fuse-ld=lld, if lld is available.
|
||||
// RUN: %clang -### %s --target=riscv32 -fuse-ld=lld \
|
||||
// RUN: %clang -### %s --target=riscv32 -fuse-ld=lld -B%S/Inputs/lld \
|
||||
// RUN: --gcc-toolchain=%S/Inputs/basic_riscv64_tree 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=LLD %s
|
||||
// LLD: {{(error: invalid linker name in argument '-fuse-ld=lld')|(ld.lld)}}
|
||||
// LLD: ld.lld
|
||||
|
||||
// In the below tests, --rtlib=platform is used so that the driver ignores
|
||||
// the configure-time CLANG_DEFAULT_RTLIB option when choosing the runtime lib
|
||||
|
||||
Reference in New Issue
Block a user