https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/121081
>From 75aa55a129dd1311a889a9bb4b0f4ee04206d157 Mon Sep 17 00:00:00 2001 From: Vitaly Buka <vitalyb...@google.com> Date: Tue, 24 Dec 2024 19:38:02 -0800 Subject: [PATCH 1/4] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?UTF-8?q?itial=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created using spr 1.3.4 --- clang/test/Driver/sanitizer-ld.c | 303 ++++++++++++++++++------------- 1 file changed, 174 insertions(+), 129 deletions(-) diff --git a/clang/test/Driver/sanitizer-ld.c b/clang/test/Driver/sanitizer-ld.c index 8f2f7a5997ab4a..0c36da1773c9f1 100644 --- a/clang/test/Driver/sanitizer-ld.c +++ b/clang/test/Driver/sanitizer-ld.c @@ -1,14 +1,17 @@ // Test sanitizers ld flags. +// RUN: export FILECHECK_OPTS="--implicit-check-not=\"/libclang_rt\"" + // RUN: %clang -### %s 2>&1 \ // RUN: --target=i386-unknown-linux -fuse-ld=ld -fsanitize=address \ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-LINUX %s // -// CHECK-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-ASAN-LINUX-NOT: "-lc" -// CHECK-ASAN-LINUX: libclang_rt.asan.a" +// CHECK-ASAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" "--no-whole-archive" +// CHECK-ASAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive" // CHECK-ASAN-LINUX-NOT: "--export-dynamic" // CHECK-ASAN-LINUX: "--dynamic-list={{.*}}libclang_rt.asan.a.syms" // CHECK-ASAN-LINUX-NOT: "--export-dynamic" @@ -23,17 +26,16 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-NO-LINK-RUNTIME-LINUX %s // -// CHECK-ASAN-NO-LINK-RUNTIME-LINUX-NOT: libclang_rt.asan_static-x86_64 -// CHECK-ASAN-NO-LINK-RUNTIME-LINUX-NOT: libclang_rt.asan-x86_64 +// CHECK-ASAN-NO-LINK-RUNTIME-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" -// RUN: %clang -fsanitize=address -fno-sanitize-link-runtime -### %s 2>&1 \ +// RUN: %clang -fsanitize=address -fsanitize-link-runtime -### %s 2>&1 \ // RUN: --target=arm64e-apple-macosx -fuse-ld=ld \ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-NO-LINK-RUNTIME-DARWIN %s // -// CHECK-ASAN-NO-LINK-RUNTIME-DARWIN-NOT: libclang_rt.asan_static -// CHECK-ASAN-NO-LINK-RUNTIME-DARWIN-NOT: libclang_rt.asan +// CHECK-ASAN-NO-LINK-RUNTIME-DARWIN: /libclang_rt.asan_osx_dynamic.dylib +// CHECK-ASAN-NO-LINK-RUNTIME-DARWIN: /libclang_rt.osx.a // RUN: %clang -fsanitize=address -### %s 2>&1 \ // RUN: --target=x86_64-unknown-linux -fuse-ld=ld \ @@ -41,8 +43,9 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-EXECUTABLE-LINUX %s // -// CHECK-ASAN-EXECUTABLE-LINUX: libclang_rt.asan_static -// CHECK-ASAN-EXECUTABLE-LINUX: libclang_rt.asan +// CHECK-ASAN-EXECUTABLE-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" "--no-whole-archive" +// CHECK-ASAN-EXECUTABLE-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive" +// CHECK-ASAN-EXECUTABLE-LINUX: "--dynamic-list={{.*}}libclang_rt.asan.a.syms" // RUN: %clang -fsanitize=address -shared -### %s 2>&1 \ // RUN: --target=x86_64-unknown-linux -fuse-ld=ld \ @@ -51,7 +54,6 @@ // RUN: | FileCheck --check-prefix=CHECK-ASAN-SHARED-LINUX %s // // CHECK-ASAN-SHARED-LINUX: libclang_rt.asan_static -// CHECK-ASAN-SHARED-LINUX-NOT: libclang_rt.asan // RUN: %clang -### %s 2>&1 \ // RUN: --target=i386-unknown-linux -fuse-ld=ld -fsanitize=address -shared-libsan \ @@ -72,11 +74,11 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-SHARED-ASAN-LINUX %s // -// CHECK-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-SHARED-ASAN-LINUX-NOT: "-lc" -// CHECK-SHARED-ASAN-LINUX-NOT: libclang_rt.asan.a" // CHECK-SHARED-ASAN-LINUX: libclang_rt.asan.so" // CHECK-SHARED-ASAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan-preinit.a" "--no-whole-archive" +// CHECK-SHARED-ASAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" "--no-whole-archive" // CHECK-SHARED-ASAN-LINUX-NOT: "-lpthread" // CHECK-SHARED-ASAN-LINUX-NOT: "-lrt" // CHECK-SHARED-ASAN-LINUX-NOT: "-ldl" @@ -90,11 +92,10 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-DSO-SHARED-ASAN-LINUX %s // -// CHECK-DSO-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-DSO-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-DSO-SHARED-ASAN-LINUX-NOT: "-lc" -// CHECK-DSO-SHARED-ASAN-LINUX-NOT: libclang_rt.asan.a" -// CHECK-DSO-SHARED-ASAN-LINUX-NOT: "libclang_rt.asan-preinit.a" // CHECK-DSO-SHARED-ASAN-LINUX: libclang_rt.asan.so" +// CHECK-DSO-SHARED-ASAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" "--no-whole-archive" // CHECK-DSO-SHARED-ASAN-LINUX-NOT: "-lpthread" // CHECK-DSO-SHARED-ASAN-LINUX-NOT: "-lrt" // CHECK-DSO-SHARED-ASAN-LINUX-NOT: "-ldl" @@ -108,11 +109,10 @@ // RUN: --sysroot=%S/Inputs/basic_freebsd_tree \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-FREEBSD %s // -// CHECK-ASAN-FREEBSD: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-ASAN-FREEBSD: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-ASAN-FREEBSD-NOT: "-lc" -// CHECK-ASAN-FREEBSD-NOT: libclang_rt.asan_cxx +// CHECK-ASAN-FREEBSD: freebsd{{/|\\+}}libclang_rt.asan_static.a" // CHECK-ASAN-FREEBSD: freebsd{{/|\\+}}libclang_rt.asan.a" -// CHECK-ASAN-FREEBSD-NOT: libclang_rt.asan_cxx // CHECK-ASAN-FREEBSD-NOT: "--dynamic-list" // CHECK-ASAN-FREEBSD: "--export-dynamic" // CHECK-ASAN-FREEBSD: "-lpthread" @@ -124,8 +124,10 @@ // RUN: --sysroot=%S/Inputs/basic_freebsd_tree \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-FREEBSD-LDL %s // -// CHECK-ASAN-FREEBSD-LDL: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-ASAN-FREEBSD-LDL: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-ASAN-FREEBSD-LDL-NOT: "-ldl" +// CHECK-ASAN-FREEBSD-LDL: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" "--no-whole-archive" +// CHECK-ASAN-FREEBSD-LDL: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive" // RUN: %clangxx -### %s 2>&1 \ // RUN: --target=i386-unknown-linux -fuse-ld=ld -stdlib=platform -fsanitize=address \ @@ -140,7 +142,7 @@ // RUN: -fsanitize-link-c++-runtime \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-LINUX-CXX %s -// CHECK-ASAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-ASAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-ASAN-LINUX-CXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive" // CHECK-ASAN-LINUX-CXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan_cxx.a" "--no-whole-archive" // CHECK-ASAN-LINUX-CXX-NOT: "--dynamic-list" @@ -159,9 +161,8 @@ // RUN: -fno-sanitize-link-c++-runtime \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-LINUX-CNOCXX %s -// CHECK-ASAN-LINUX-CNOCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-ASAN-LINUX-CNOCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-ASAN-LINUX-CNOCXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive" -// CHECK-ASAN-LINUX-CNOCXX-NOT: libclang_rt.asan_cxx // CHECK-ASAN-LINUX-CNOCXX-SAME: "--export-dynamic" // CHECK-ASAN-LINUX-CNOCXX-NOT: stdc++ // CHECK-ASAN-LINUX-CNOCXX-SAME: "-lpthread" @@ -177,9 +178,8 @@ // RUN: -fno-sanitize-link-c++-runtime \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-LINUX-NOCXX %s -// CHECK-ASAN-LINUX-NOCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-ASAN-LINUX-NOCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-ASAN-LINUX-NOCXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive" -// CHECK-ASAN-LINUX-NOCXX-NOT: libclang_rt.asan_cxx // CHECK-ASAN-LINUX-NOCXX-SAME: "--export-dynamic" // CHECK-ASAN-LINUX-NOCXX-SAME: "-lstdc++" // CHECK-ASAN-LINUX-NOCXX-SAME: "-lpthread" @@ -195,9 +195,9 @@ // RUN: -nostdlib++ \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-LINUX-NOSTDCXX %s -// CHECK-ASAN-LINUX-NOSTDCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-ASAN-LINUX-NOSTDCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-ASAN-LINUX-NOSTDCXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive" -// CHECK-ASAN-LINUX-NOSTDCXX-SAME: libclang_rt.asan_cxx +// CHECK-ASAN-LINUX-NOSTDCXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan_cxx.a" "--no-whole-archive" // CHECK-ASAN-LINUX-NOSTDCXX-SAME: "--export-dynamic" // CHECK-ASAN-LINUX-NOSTDCXX-SAME: "-lpthread" // CHECK-ASAN-LINUX-NOSTDCXX-SAME: "-lrt" @@ -211,9 +211,10 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree -lstdc++ -static 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-LINUX-CXX-STATIC %s // -// CHECK-ASAN-LINUX-CXX-STATIC: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-ASAN-LINUX-CXX-STATIC: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-ASAN-LINUX-CXX-STATIC-NOT: stdc++ // CHECK-ASAN-LINUX-CXX-STATIC: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive" +// CHECK-ASAN-LINUX-CXX-STATIC: "--dynamic-list={{.*}}libclang_rt.asan.a.syms" // CHECK-ASAN-LINUX-CXX-STATIC: stdc++ // RUN: %clang -### %s 2>&1 \ @@ -221,8 +222,9 @@ // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-ARM %s // -// CHECK-ASAN-ARM: "{{(.*[^.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-ASAN-ARM: "{{(.*[^.0-9A-Z_a-z])?}}ld" // CHECK-ASAN-ARM-NOT: "-lc" +// CHECK-ASAN-ARM: libclang_rt.asan_static.a" // CHECK-ASAN-ARM: libclang_rt.asan.a" // // RUN: %clang -### %s 2>&1 \ @@ -230,8 +232,9 @@ // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-ARMv7 %s // -// CHECK-ASAN-ARMv7: "{{(.*[^.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-ASAN-ARMv7: "{{(.*[^.0-9A-Z_a-z])?}}ld" // CHECK-ASAN-ARMv7-NOT: "-lc" +// CHECK-ASAN-ARMv7: libclang_rt.asan_static.a" // CHECK-ASAN-ARMv7: libclang_rt.asan.a" // RUN: %clang -### %s 2>&1 \ @@ -240,12 +243,15 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-ANDROID %s // -// CHECK-ASAN-ANDROID: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}" +// CHECK-ASAN-ANDROID: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld" // CHECK-ASAN-ANDROID: "-pie" // CHECK-ASAN-ANDROID-NOT: "-lc" // CHECK-ASAN-ANDROID-NOT: "-lpthread" // CHECK-ASAN-ANDROID-NOT: "-lresolv" // CHECK-ASAN-ANDROID: libclang_rt.asan.so" +// CHECK-ASAN-ANDROID: libclang_rt.asan_static.a" +// CHECK-ASAN-ANDROID: libclang_rt.builtins.a +// CHECK-ASAN-ANDROID: libclang_rt.builtins.a // CHECK-ASAN-ANDROID-NOT: "-lpthread" // CHECK-ASAN-ANDROID-NOT: "-lresolv" @@ -263,8 +269,11 @@ // RUN: -static-libasan \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-ANDROID-STATICLIBASAN %s // -// CHECK-ASAN-ANDROID-STATICLIBASAN: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}" +// CHECK-ASAN-ANDROID-STATICLIBASAN: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld" +// CHECK-ASAN-ANDROID-STATICLIBASAN: libclang_rt.asan_static.a" // CHECK-ASAN-ANDROID-STATICLIBASAN: libclang_rt.asan.a" +// CHECK-ASAN-ANDROID-STATICLIBASAN: libclang_rt.builtins.a" +// CHECK-ASAN-ANDROID-STATICLIBASAN: libclang_rt.builtins.a" // CHECK-ASAN-ANDROID-STATICLIBASAN-NOT: "-lpthread" // CHECK-ASAN-ANDROID-STATICLIBASAN-NOT: "-lrt" // CHECK-ASAN-ANDROID-STATICLIBASAN-NOT: "-lresolv" @@ -275,12 +284,14 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: | FileCheck --check-prefix=CHECK-UBSAN-ANDROID %s // -// CHECK-UBSAN-ANDROID: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}" +// CHECK-UBSAN-ANDROID: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld" // CHECK-UBSAN-ANDROID: "-pie" // CHECK-UBSAN-ANDROID-NOT: "-lc" // CHECK-UBSAN-ANDROID-NOT: "-lpthread" // CHECK-UBSAN-ANDROID-NOT: "-lresolv" // CHECK-UBSAN-ANDROID: libclang_rt.ubsan_standalone.so" +// CHECK-UBSAN-ANDROID: libclang_rt.builtins.a" +// CHECK-UBSAN-ANDROID: libclang_rt.builtins.a" // CHECK-UBSAN-ANDROID-NOT: "-lpthread" // CHECK-UBSAN-ANDROID-NOT: "-lresolv" @@ -291,8 +302,10 @@ // RUN: -static-libsan \ // RUN: | FileCheck --check-prefix=CHECK-UBSAN-ANDROID-STATICLIBASAN %s // -// CHECK-UBSAN-ANDROID-STATICLIBASAN: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}" +// CHECK-UBSAN-ANDROID-STATICLIBASAN: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld" // CHECK-UBSAN-ANDROID-STATICLIBASAN: libclang_rt.ubsan_standalone.a" +// CHECK-UBSAN-ANDROID-STATICLIBASAN: libclang_rt.builtins.a" +// CHECK-UBSAN-ANDROID-STATICLIBASAN: libclang_rt.builtins.a" // CHECK-UBSAN-ANDROID-STATICLIBASAN-NOT: "-lpthread" // CHECK-UBSAN-ANDROID-STATICLIBASAN-NOT: "-lrt" // CHECK-UBSAN-ANDROID-STATICLIBASAN-NOT: "-lresolv" @@ -304,12 +317,15 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-ANDROID-X86 %s // -// CHECK-ASAN-ANDROID-X86: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}" +// CHECK-ASAN-ANDROID-X86: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld" // CHECK-ASAN-ANDROID-X86: "-pie" // CHECK-ASAN-ANDROID-X86-NOT: "-lc" // CHECK-ASAN-ANDROID-X86-NOT: "-lpthread" // CHECK-ASAN-ANDROID-X86-NOT: "-lresolv" // CHECK-ASAN-ANDROID-X86: libclang_rt.asan.so" +// CHECK-ASAN-ANDROID-X86: libclang_rt.asan_static.a" +// CHECK-ASAN-ANDROID-X86: libclang_rt.builtins.a" +// CHECK-ASAN-ANDROID-X86: libclang_rt.builtins.a" // CHECK-ASAN-ANDROID-X86-NOT: "-lpthread" // CHECK-ASAN-ANDROID-X86-NOT: "-lresolv" // @@ -320,6 +336,10 @@ // RUN: | FileCheck --check-prefix=CHECK-ASAN-ANDROID-SHARED-LIBASAN %s // // CHECK-ASAN-ANDROID-SHARED-LIBASAN-NOT: argument unused during compilation: '-shared-libsan' +// CHECK-ASAN-ANDROID-SHARED-LIBASAN: libclang_rt.asan.so" +// CHECK-ASAN-ANDROID-SHARED-LIBASAN: libclang_rt.asan_static.a" +// CHECK-ASAN-ANDROID-SHARED-LIBASAN: libclang_rt.builtins.a" +// CHECK-ASAN-ANDROID-SHARED-LIBASAN: libclang_rt.builtins.a" // // RUN: %clang -### %s 2>&1 \ // RUN: --target=arm-linux-androideabi -fuse-ld=ld -fsanitize=address \ @@ -328,9 +348,12 @@ // RUN: -shared \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-ANDROID-SHARED %s // -// CHECK-ASAN-ANDROID-SHARED: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}" +// CHECK-ASAN-ANDROID-SHARED: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld" // CHECK-ASAN-ANDROID-SHARED-NOT: "-lc" // CHECK-ASAN-ANDROID-SHARED: libclang_rt.asan.so" +// CHECK-ASAN-ANDROID-SHARED: libclang_rt.asan_static.a" +// CHECK-ASAN-ANDROID-SHARED: libclang_rt.builtins.a" +// CHECK-ASAN-ANDROID-SHARED: libclang_rt.builtins.a" // CHECK-ASAN-ANDROID-SHARED-NOT: "-lpthread" // CHECK-ASAN-ANDROID-SHARED-NOT: "-lresolv" @@ -342,7 +365,7 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-TYSAN-LINUX-CXX %s // -// CHECK-TYSAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-TYSAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-TYSAN-LINUX-CXX-NOT: stdc++ // CHECK-TYSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.tysan{{[^.]*}}.a" "--no-whole-archive" // CHECK-TYSAN-LINUX-CXX: stdc++ @@ -353,8 +376,9 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-TYSAN-DARWIN-CXX %s -// CHECK-TYSAN-DARWIN-CXX: "{{.*}}ld{{(.exe)?}}" +// CHECK-TYSAN-DARWIN-CXX: "{{.*}}ld" // CHECK-TYSAN-DARWIN-CXX: libclang_rt.tysan_osx_dynamic.dylib +// CHECK-TYSAN-DARWIN-CXX: libclang_rt.osx.a // CHECK-TYSAN-DARWIN-CXX-NOT: -lc++abi // RUN: %clangxx -### %s 2>&1 \ @@ -364,7 +388,7 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-TSAN-LINUX-CXX %s // -// CHECK-TSAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-TSAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-TSAN-LINUX-CXX-NOT: stdc++ // CHECK-TSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.tsan.a" "--no-whole-archive" // CHECK-TSAN-LINUX-CXX: "--dynamic-list={{.*}}libclang_rt.tsan.a.syms" @@ -383,7 +407,7 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-TSAN-NO-LINK-RUNTIME-LINUX %s // -// CHECK-TSAN-NO-LINK-RUNTIME-LINUX-NOT: libclang_rt.tsan +// CHECK-TSAN-NO-LINK-RUNTIME-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // RUN: not %clang -fsanitize=thread -fno-sanitize-link-runtime -### %s 2>&1 \ // RUN: --target=arm64e-apple-ios -fuse-ld=ld \ @@ -391,7 +415,7 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-TSAN-NO-LINK-RUNTIME-DARWIN %s // -// CHECK-TSAN-NO-LINK-RUNTIME-DARWIN-NOT: libclang_rt.tsan +// CHECK-TSAN-NO-LINK-RUNTIME-DARWIN: libclang_rt.ios.a // RUN: %clangxx -### %s 2>&1 \ // RUN: --target=x86_64-unknown-linux -fuse-ld=ld -stdlib=platform -lstdc++ \ @@ -400,7 +424,7 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-MSAN-LINUX-CXX %s // -// CHECK-MSAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-MSAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-MSAN-LINUX-CXX-NOT: stdc++ // CHECK-MSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.msan.a" "--no-whole-archive" // CHECK-MSAN-LINUX-CXX: "--dynamic-list={{.*}}libclang_rt.msan.a.syms" @@ -419,7 +443,7 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-MSAN-NO-LINK-RUNTIME-LINUX %s // -// CHECK-MSAN-NO-LINK-RUNTIME-LINUX-NOT: libclang_rt.msan +// CHECK-MSAN-NO-LINK-RUNTIME-LINUX: "{{.*}}ld" // RUN: %clang -fsanitize=undefined -### %s 2>&1 \ // RUN: --target=x86_64-unknown-linux-gnux32 -fuse-ld=ld \ @@ -440,12 +464,8 @@ // RUN: -static-libsan \ // RUN: | FileCheck --check-prefix=CHECK-UBSAN-LINUX %s -// CHECK-UBSAN-LINUX: "{{.*}}ld{{(.exe)?}}" -// CHECK-UBSAN-LINUX-NOT: libclang_rt.asan -// CHECK-UBSAN-LINUX-NOT: libclang_rt.ubsan_standalone_cxx +// CHECK-UBSAN-LINUX: "{{.*}}ld" // CHECK-UBSAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.ubsan_standalone.a" "--no-whole-archive" -// CHECK-UBSAN-LINUX-NOT: libclang_rt.asan -// CHECK-UBSAN-LINUX-NOT: libclang_rt.ubsan_standalone_cxx // CHECK-UBSAN-LINUX-NOT: "-lstdc++" // CHECK-UBSAN-LINUX: "-lpthread" // CHECK-UBSAN-LINUX: "-lresolv" @@ -456,7 +476,7 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-UBSAN-NO-LINK-RUNTIME-LINUX %s // -// CHECK-UBSAN-NO-LINK-RUNTIME-LINUX-NOT: libclang_rt.undefined +// CHECK-UBSAN-NO-LINK-RUNTIME-LINUX: "{{.*}}ld" // RUN: %clang -fsanitize=undefined -fno-sanitize-link-runtime -### %s 2>&1 \ // RUN: --target=x86_64-apple-darwin -fuse-ld=ld \ @@ -464,7 +484,8 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-UBSAN-NO-LINK-RUNTIME-DARWIN %s // -// CHECK-UBSAN-NO-LINK-RUNTIME-DARWIN-NOT: libclang_rt.ubsan +// CHECK-UBSAN-NO-LINK-RUNTIME-DARWIN: "{{.*}}ld" +// CHECK-UBSAN-NO-LINK-RUNTIME-DARWIN: libclang_rt.osx.a // RUN: %clang -fsanitize=fuzzer -fno-sanitize-link-runtime -### %s 2>&1 \ // RUN: --target=arm64e-apple-watchos -fuse-ld=ld \ @@ -472,7 +493,8 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-FUZZER-NO-LINK-RUNTIME-DARWIN %s // -// CHECK-FUZZER-NO-LINK-RUNTIME-DARWIN-NOT: libclang_rt.fuzzer +// CHECK-FUZZER-NO-LINK-RUNTIME-DARWIN: "{{.*}}ld" +// CHECK-FUZZER-NO-LINK-RUNTIME-DARWIN: libclang_rt.watchos.a // RUN: %clang -fsanitize=undefined -### %s 2>&1 \ // RUN: --target=i386-unknown-linux -fuse-ld=ld \ @@ -495,7 +517,7 @@ // RUN: -shared -shared-libsan \ // RUN: | FileCheck --check-prefix=CHECK-UBSAN-LINUX-SHAREDLIBASAN %s -// CHECK-UBSAN-LINUX-SHAREDLIBASAN: "{{.*}}ld{{(.exe)?}}" +// CHECK-UBSAN-LINUX-SHAREDLIBASAN: "{{.*}}ld" // CHECK-UBSAN-LINUX-SHAREDLIBASAN: "{{.*}}libclang_rt.ubsan_standalone.so{{.*}}" // RUN: %clang -fsanitize=undefined -fsanitize-link-c++-runtime -### %s 2>&1 \ @@ -512,14 +534,10 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-UBSAN-LINUX-CXX %s -// CHECK-UBSAN-LINUX-CXX: "{{.*}}ld{{(.exe)?}}" -// CHECK-UBSAN-LINUX-CXX-NOT: libclang_rt.asan +// CHECK-UBSAN-LINUX-CXX: "{{.*}}ld" // CHECK-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.ubsan_standalone.a" "--no-whole-archive" -// CHECK-UBSAN-LINUX-CXX-NOT: libclang_rt.asan // CHECK-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.ubsan_standalone_cxx.a" "--no-whole-archive" -// CHECK-UBSAN-LINUX-CXX-NOT: libclang_rt.asan // CHECK-UBSAN-LINUX-CXX: "-lstdc++" -// CHECK-UBSAN-LINUX-CXX-NOT: libclang_rt.asan // CHECK-UBSAN-LINUX-CXX: "-lpthread" // CHECK-UBSAN-LINUX-CXX: "-lresolv" @@ -528,7 +546,7 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-UBSAN-MINIMAL-LINUX %s -// CHECK-UBSAN-MINIMAL-LINUX: "{{.*}}ld{{(.exe)?}}" +// CHECK-UBSAN-MINIMAL-LINUX: "{{.*}}ld" // CHECK-UBSAN-MINIMAL-LINUX: "--whole-archive" "{{.*}}libclang_rt.ubsan_minimal.a" "--no-whole-archive" // CHECK-UBSAN-MINIMAL-LINUX: "-lpthread" // CHECK-UBSAN-MINIMAL-LINUX: "-lresolv" @@ -537,7 +555,7 @@ // RUN: --target=x86_64-apple-darwin -fuse-ld=ld \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-UBSAN-MINIMAL-DARWIN %s -// CHECK-UBSAN-MINIMAL-DARWIN: "{{.*}}ld{{(.exe)?}}" +// CHECK-UBSAN-MINIMAL-DARWIN: "{{.*}}ld" // CHECK-UBSAN-MINIMAL-DARWIN: "{{.*}}libclang_rt.ubsan_minimal_osx_dynamic.dylib" // RUN: not %clang -fsanitize=undefined -### %s 2>&1 \ @@ -563,9 +581,10 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-UBSAN-LINUX %s -// CHECK-ASAN-UBSAN-LINUX: "{{.*}}ld{{(.exe)?}}" +// CHECK-ASAN-UBSAN-LINUX: "{{.*}}ld" +// CHECK-ASAN-UBSAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" "--no-whole-archive" // CHECK-ASAN-UBSAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive" -// CHECK-ASAN-UBSAN-LINUX-NOT: libclang_rt.ubsan +// CHECK-ASAN-UBSAN-LINUX: "--dynamic-list={{.*}}libclang_rt.asan.a.syms" // CHECK-ASAN-UBSAN-LINUX-NOT: "-lstdc++" // CHECK-ASAN-UBSAN-LINUX: "-lpthread" // CHECK-ASAN-UBSAN-LINUX: "-lresolv" @@ -575,12 +594,12 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-UBSAN-LINUX-CXX %s -// CHECK-ASAN-UBSAN-LINUX-CXX: "{{.*}}ld{{(.exe)?}}" +// CHECK-ASAN-UBSAN-LINUX-CXX: "{{.*}}ld" +// CHECK-ASAN-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" "--no-whole-archive" // CHECK-ASAN-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive" +// CHECK-ASAN-UBSAN-LINUX-CXX: "--dynamic-list={{.*}}libclang_rt.asan.a.syms" // CHECK-ASAN-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.asan_cxx.a" "--no-whole-archive" -// CHECK-ASAN-UBSAN-LINUX-CXX-NOT: libclang_rt.ubsan -// CHECK-ASAN-UBSAN-LINUX-CXX: libclang_rt.ubsan_standalone_cxx -// CHECK-ASAN-UBSAN-LINUX-CXX-NOT: libclang_rt.ubsan +// CHECK-ASAN-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.ubsan_standalone_cxx.a" "--no-whole-archive" // CHECK-ASAN-UBSAN-LINUX-CXX: "-lstdc++" // CHECK-ASAN-UBSAN-LINUX-CXX: "-lpthread" // CHECK-ASAN-UBSAN-LINUX-CXX: "-lresolv" @@ -590,10 +609,11 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-UBSAN-NOVPTR-LINUX-CXX %s -// CHECK-ASAN-UBSAN-NOVPTR-LINUX-CXX: "{{.*}}ld{{(.exe)?}}" +// CHECK-ASAN-UBSAN-NOVPTR-LINUX-CXX: "{{.*}}ld" +// CHECK-ASAN-UBSAN-NOVPTR-LINUX-CXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" "--no-whole-archive" // CHECK-ASAN-UBSAN-NOVPTR-LINUX-CXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive" +// CHECK-ASAN-UBSAN-NOVPTR-LINUX-CXX-SAME: "--dynamic-list={{.*}}libclang_rt.asan.a.syms" // CHECK-ASAN-UBSAN-NOVPTR-LINUX-CXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan_cxx.a" "--no-whole-archive" -// CHECK-ASAN-UBSAN-NOVPTR-LINUX-CXX-NOT: libclang_rt.ubsan // CHECK-ASAN-UBSAN-NOVPTR-LINUX-CXX-SAME: "-lstdc++" // CHECK-ASAN-UBSAN-NOVPTR-LINUX-CXX-SAME: "-lpthread" // CHECK-ASAN-UBSAN-NOVPTR-LINUX-CXX-SAME: "-lresolv" @@ -603,22 +623,24 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-MSAN-UBSAN-LINUX-CXX %s -// CHECK-MSAN-UBSAN-LINUX-CXX: "{{.*}}ld{{(.exe)?}}" +// CHECK-MSAN-UBSAN-LINUX-CXX: "{{.*}}ld" // CHECK-MSAN-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.msan.a" "--no-whole-archive" -// CHECK-MSAN-UBSAN-LINUX-CXX-NOT: libclang_rt.ubsan -// CHECK-MSAN-UBSAN-LINUX-CXX: libclang_rt.ubsan_standalone_cxx -// CHECK-MSAN-UBSAN-LINUX-CXX-NOT: libclang_rt.ubsan +// CHECK-MSAN-UBSAN-LINUX-CXX: "--dynamic-list={{.*}}libclang_rt.msan.a.syms" +// CHECK-MSAN-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.msan_cxx.a" "--no-whole-archive" +// CHECK-MSAN-UBSAN-LINUX-CXX: "--dynamic-list={{.*}}libclang_rt.msan_cxx.a.syms" +// CHECK-MSAN-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.ubsan_standalone_cxx.a" "--no-whole-archive" // RUN: %clangxx -fsanitize=thread,undefined -### %s 2>&1 \ // RUN: --target=x86_64-unknown-linux -fuse-ld=ld \ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-TSAN-UBSAN-LINUX-CXX %s -// CHECK-TSAN-UBSAN-LINUX-CXX: "{{.*}}ld{{(.exe)?}}" +// CHECK-TSAN-UBSAN-LINUX-CXX: "{{.*}}ld" // CHECK-TSAN-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.tsan.a" "--no-whole-archive" -// CHECK-TSAN-UBSAN-LINUX-CXX-NOT: libclang_rt.ubsan -// CHECK-TSAN-UBSAN-LINUX-CXX: libclang_rt.ubsan_standalone_cxx -// CHECK-TSAN-UBSAN-LINUX-CXX-NOT: libclang_rt.ubsan +// CHECK-TSAN-UBSAN-LINUX-CXX: "--dynamic-list={{.*}}libclang_rt.tsan.a.syms" +// CHECK-TSAN-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.tsan_cxx.a" "--no-whole-archive" +// CHECK-TSAN-UBSAN-LINUX-CXX: "--dynamic-list={{.*}}libclang_rt.tsan_cxx.a.syms" +// CHECK-TSAN-UBSAN-LINUX-CXX: "--whole-archive" "{{.*}}libclang_rt.ubsan_standalone_cxx.a" "--no-whole-archive" // RUN: %clang -fsanitize=undefined -### %s 2>&1 \ // RUN: --target=i386-unknown-linux -fuse-ld=ld \ @@ -626,10 +648,9 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: -shared \ // RUN: | FileCheck --check-prefix=CHECK-UBSAN-LINUX-SHARED %s -// CHECK-UBSAN-LINUX-SHARED: "{{.*}}ld{{(.exe)?}}" +// CHECK-UBSAN-LINUX-SHARED: "{{.*}}ld" // CHECK-UBSAN-LINUX-SHARED-NOT: --export-dynamic // CHECK-UBSAN-LINUX-SHARED-NOT: --dynamic-list -// CHECK-UBSAN-LINUX-SHARED-NOT: libclang_rt.ubsan // RUN: %clang -### %s 2>&1 \ // RUN: --target=x86_64-unknown-linux -fuse-ld=ld -fsanitize=leak \ @@ -637,9 +658,8 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-LSAN-LINUX %s // -// CHECK-LSAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-LSAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-LSAN-LINUX-NOT: "-lc" -// CHECK-LSAN-LINUX-NOT: libclang_rt.ubsan // CHECK-LSAN-LINUX: libclang_rt.lsan.a" // CHECK-LSAN-LINUX: "-lpthread" // CHECK-LSAN-LINUX: "-ldl" @@ -651,7 +671,7 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-LSAN-NO-LINK-RUNTIME-LINUX %s // -// CHECK-LSAN-NO-LINK-RUNTIME-LINUX-NOT: libclang_rt.lsan +// CHECK-LSAN-NO-LINK-RUNTIME-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // RUN: %clang -### %s 2>&1 \ // RUN: --target=x86_64-unknown-linux -fuse-ld=ld -fsanitize=leak -fsanitize-coverage=func \ @@ -659,11 +679,10 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-LSAN-COV-LINUX %s // -// CHECK-LSAN-COV-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-LSAN-COV-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-LSAN-COV-LINUX-NOT: "-lc" -// CHECK-LSAN-COV-LINUX-NOT: libclang_rt.ubsan +// CHECK-LSAN-COV-LINUX: libclang_rt.lsan.a // CHECK-LSAV-COV-LINUX: libclang_rt.lsan-x86_64.a" -// CHECK-LSAN-COV-LINUX-NOT: libclang_rt.ubsan // CHECK-LSAN-COV-LINUX: "-lpthread" // CHECK-LSAN-COV-LINUX: "-ldl" // CHECK-LSAN-COV-LINUX: "-lresolv" @@ -673,19 +692,20 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-LSAN-ASAN-LINUX %s -// CHECK-LSAN-ASAN-LINUX: "{{.*}}ld{{(.exe)?}}" -// CHECK-LSAN-ASAN-LINUX-NOT: libclang_rt.lsan +// CHECK-LSAN-ASAN-LINUX: "{{.*}}ld" +// CHECK-LSAN-ASAN-LINUX: libclang_rt.asan_static // CHECK-LSAN-ASAN-LINUX: libclang_rt.asan -// CHECK-LSAN-ASAN-LINUX-NOT: libclang_rt.lsan +// CHECK-LSAN-ASAN-LINUX: "--dynamic-list={{.*}}libclang_rt.asan.a.syms" // RUN: %clang -fsanitize=address -fsanitize-coverage=func -### %s 2>&1 \ // RUN: --target=x86_64-unknown-linux -fuse-ld=ld \ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-COV-LINUX %s -// CHECK-ASAN-COV-LINUX: "{{.*}}ld{{(.exe)?}}" -// CHECK-ASAN-COV-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan.a" "--no-whole-archive" -// CHECK-ASAN-COV-LINUX-NOT: libclang_rt.ubsan +// CHECK-ASAN-COV-LINUX: "{{.*}}ld" +// CHECK-ASAN-COV-LINUX: libclang_rt.asan_static +// CHECK-ASAN-COV-LINUX: libclang_rt.asan +// CHECK-ASAN-COV-LINUX: "--dynamic-list={{.*}}libclang_rt.asan.a.syms" // CHECK-ASAN-COV-LINUX-NOT: "-lstdc++" // CHECK-ASAN-COV-LINUX: "-lpthread" // CHECK-ASAN-COV-LINUX: "-lresolv" @@ -695,9 +715,9 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-MSAN-COV-LINUX %s -// CHECK-MSAN-COV-LINUX: "{{.*}}ld{{(.exe)?}}" +// CHECK-MSAN-COV-LINUX: "{{.*}}ld" // CHECK-MSAN-COV-LINUX: "--whole-archive" "{{.*}}libclang_rt.msan.a" "--no-whole-archive" -// CHECK-MSAN-COV-LINUX-NOT: libclang_rt.ubsan +// CHECK-MSAN-COV-LINUX: "--dynamic-list={{.*}}libclang_rt.msan.a.syms" // CHECK-MSAN-COV-LINUX-NOT: "-lstdc++" // CHECK-MSAN-COV-LINUX: "-lpthread" // CHECK-MSAN-COV-LINUX: "-lresolv" @@ -707,9 +727,8 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-DFSAN-COV-LINUX %s -// CHECK-DFSAN-COV-LINUX: "{{.*}}ld{{(.exe)?}}" +// CHECK-DFSAN-COV-LINUX: "{{.*}}ld" // CHECK-DFSAN-COV-LINUX: "--whole-archive" "{{.*}}libclang_rt.dfsan.a" "--no-whole-archive" -// CHECK-DFSAN-COV-LINUX-NOT: libclang_rt.ubsan // CHECK-DFSAN-COV-LINUX-NOT: "-lstdc++" // CHECK-DFSAN-COV-LINUX: "-lpthread" // CHECK-DFSAN-COV-LINUX: "-lresolv" @@ -719,7 +738,7 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-UBSAN-COV-LINUX %s -// CHECK-UBSAN-COV-LINUX: "{{.*}}ld{{(.exe)?}}" +// CHECK-UBSAN-COV-LINUX: "{{.*}}ld" // CHECK-UBSAN-COV-LINUX: "--whole-archive" "{{.*}}libclang_rt.ubsan_standalone.a" "--no-whole-archive" // CHECK-UBSAN-COV-LINUX-NOT: "-lstdc++" // CHECK-UBSAN-COV-LINUX: "-lpthread" @@ -730,7 +749,7 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-COV-LINUX %s -// CHECK-COV-LINUX: "{{.*}}ld{{(.exe)?}}" +// CHECK-COV-LINUX: "{{.*}}ld" // CHECK-COV-LINUX: "--whole-archive" "{{.*}}libclang_rt.ubsan_standalone.a" "--no-whole-archive" // CHECK-COV-LINUX-NOT: "-lstdc++" // CHECK-COV-LINUX: "-lpthread" @@ -742,9 +761,8 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-NSAN-LINUX %s // -// CHECK-NSAN-LINUX: "{{.*}}ld{{(.exe)?}}" +// CHECK-NSAN-LINUX: "{{.*}}ld" // CHECK-NSAN-LINUX-NOT: "-lc" -// CHECK-NSAN-LINUX-NOT: libclang_rt.ubsan // CHECK-NSAN-LINUX: libclang_rt.nsan.a" // CHECK-NSAN-LINUX: "-lpthread" "-lrt" "-lm" "-ldl" "-lresolv" @@ -764,7 +782,6 @@ // RUN: | FileCheck --check-prefix=CHECK-NSAN-UBSAN %s // CHECK-NSAN-UBSAN: "--whole-archive" "{{[^"]*}}libclang_rt.nsan.a" "--no-whole-archive" -// CHECK-NSAN-UBSAN-NOT: libclang_rt.ubsan // CFI by itself does not link runtime libraries. // RUN: not %clang -fsanitize=cfi -### %s 2>&1 \ @@ -772,8 +789,7 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-CFI-LINUX %s -// CHECK-CFI-LINUX: "{{.*}}ld{{(.exe)?}}" -// CHECK-CFI-LINUX-NOT: libclang_rt. +// CHECK-CFI-LINUX: "{{.*}}ld" // CFI with diagnostics links the UBSan runtime. // RUN: not %clang -fsanitize=cfi -fno-sanitize-trap=cfi -fsanitize-recover=cfi \ @@ -782,7 +798,7 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-CFI-DIAG-LINUX %s -// CHECK-CFI-DIAG-LINUX: "{{.*}}ld{{(.exe)?}}" +// CHECK-CFI-DIAG-LINUX: "{{.*}}ld" // CHECK-CFI-DIAG-LINUX: "--whole-archive" "{{[^"]*}}libclang_rt.ubsan_standalone.a" "--no-whole-archive" // Cross-DSO CFI links the CFI runtime. @@ -791,7 +807,7 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-CFI-CROSS-DSO-LINUX %s -// CHECK-CFI-CROSS-DSO-LINUX: "{{.*}}ld{{(.exe)?}}" +// CHECK-CFI-CROSS-DSO-LINUX: "{{.*}}ld" // CHECK-CFI-CROSS-DSO-LINUX: "--whole-archive" "{{[^"]*}}libclang_rt.cfi.a" "--no-whole-archive" // CHECK-CFI-CROSS-DSO-LINUX: -export-dynamic @@ -802,7 +818,7 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-CFI-CROSS-DSO-DIAG-LINUX %s -// CHECK-CFI-CROSS-DSO-DIAG-LINUX: "{{.*}}ld{{(.exe)?}}" +// CHECK-CFI-CROSS-DSO-DIAG-LINUX: "{{.*}}ld" // CHECK-CFI-CROSS-DSO-DIAG-LINUX: "--whole-archive" "{{[^"]*}}libclang_rt.cfi_diag.a" "--no-whole-archive" // CHECK-CFI-CROSS-DSO-DIAG-LINUX: -export-dynamic @@ -812,8 +828,9 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_android_tree \ // RUN: | FileCheck --check-prefix=CHECK-CFI-CROSS-DSO-ANDROID %s -// CHECK-CFI-CROSS-DSO-ANDROID: "{{.*}}ld{{(.exe)?}}" -// CHECK-CFI-CROSS-DSO-ANDROID-NOT: libclang_rt.cfi +// CHECK-CFI-CROSS-DSO-ANDROID: "{{.*}}ld" +// CHECK-CFI-CROSS-DSO-ANDROID: libclang_rt.builtins.a +// CHECK-CFI-CROSS-DSO-ANDROID: libclang_rt.builtins.a // Cross-DSO CFI with diagnostics on Android links just the UBSAN runtime. // RUN: not %clang -fsanitize=cfi -fsanitize-cfi-cross-dso -### %s 2>&1 \ @@ -822,9 +839,11 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_android_tree \ // RUN: | FileCheck --check-prefix=CHECK-CFI-CROSS-DSO-DIAG-ANDROID %s -// CHECK-CFI-CROSS-DSO-DIAG-ANDROID: "{{.*}}ld{{(.exe)?}}" +// CHECK-CFI-CROSS-DSO-DIAG-ANDROID: "{{.*}}ld" // CHECK-CFI-CROSS-DSO-DIAG-ANDROID: "{{[^"]*}}libclang_rt.ubsan_standalone.so" // CHECK-CFI-CROSS-DSO-DIAG-ANDROID: "--export-dynamic-symbol=__cfi_check" +// CHECK-CFI-CROSS-DSO-DIAG-ANDROID: libclang_rt.builtins.a +// CHECK-CFI-CROSS-DSO-DIAG-ANDROID: libclang_rt.builtins.a // RUN: %clangxx -fsanitize=address -### %s 2>&1 \ // RUN: -mmacos-version-min=10.6 \ @@ -832,9 +851,10 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-ASAN-DARWIN106-CXX %s -// CHECK-ASAN-DARWIN106-CXX: "{{.*}}ld{{(.exe)?}}" +// CHECK-ASAN-DARWIN106-CXX: "{{.*}}ld" // CHECK-ASAN-DARWIN106-CXX: libclang_rt.asan_osx_dynamic.dylib // CHECK-ASAN-DARWIN106-CXX-NOT: -lc++abi +// CHECK-ASAN-DARWIN106-CXX: libclang_rt.osx.a // RUN: %clangxx -fsanitize=leak -### %s 2>&1 \ // RUN: -mmacos-version-min=10.6 \ @@ -842,9 +862,10 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-LSAN-DARWIN106-CXX %s -// CHECK-LSAN-DARWIN106-CXX: "{{.*}}ld{{(.exe)?}}" +// CHECK-LSAN-DARWIN106-CXX: "{{.*}}ld" // CHECK-LSAN-DARWIN106-CXX: libclang_rt.lsan_osx_dynamic.dylib // CHECK-LSAN-DARWIN106-CXX-NOT: -lc++abi +// CHECK-LSAN-DARWIN106-CXX: libclang_rt.osx.a // RUN: %clang -### %s 2>&1 \ // RUN: --target=x86_64-unknown-linux -fuse-ld=ld -fsanitize=safe-stack \ @@ -852,7 +873,7 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-SAFESTACK-LINUX %s // -// CHECK-SAFESTACK-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-SAFESTACK-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-SAFESTACK-LINUX-NOT: "-lc" // CHECK-SAFESTACK-LINUX-NOT: whole-archive // CHECK-SAFESTACK-LINUX: "-u" "__safestack_init" @@ -865,6 +886,7 @@ // RUN: --target=x86_64-unknown-linux -fuse-ld=ld \ // RUN: | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-X86-64 %s // CHECK-SHADOWCALLSTACK-LINUX-X86-64-NOT: error: +// CHECK-SHADOWCALLSTACK-LINUX-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // RUN: not %clang -fsanitize=shadow-call-stack -### %s 2>&1 \ // RUN: --target=aarch64-unknown-linux -fuse-ld=ld \ @@ -875,20 +897,28 @@ // RUN: --target=riscv32-unknown-elf -fuse-ld=ld \ // RUN: | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-ELF-RISCV32 %s // CHECK-SHADOWCALLSTACK-ELF-RISCV32-NOT: error: +// CHECK-SHADOWCALLSTACK-ELF-RISCV32: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld" +// CHECK-SHADOWCALLSTACK-ELF-RISCV32: libclang_rt.builtins.a // RUN: %clang -fsanitize=shadow-call-stack -### %s 2>&1 \ // RUN: --target=riscv64-unknown-linux -fuse-ld=ld \ // RUN: | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-RISCV64 %s // CHECK-SHADOWCALLSTACK-LINUX-RISCV64-NOT: error: +// CHECK-SHADOWCALLSTACK-LINUX-RISCV64: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // RUN: %clang -target riscv64-linux-android -fsanitize=shadow-call-stack %s -### 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-SHADOWCALLSTACK-ANDROID-RISCV64 // CHECK-SHADOWCALLSTACK-ANDROID-RISCV64-NOT: error: +// CHECK-SHADOWCALLSTACK-ANDROID-RISCV64: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld" +// CHECK-SHADOWCALLSTACK-ANDROID-RISCV64: libclang_rt.builtins.a +// CHECK-SHADOWCALLSTACK-ANDROID-RISCV64: libclang_rt.builtins.a // RUN: %clang -fsanitize=shadow-call-stack -### %s 2>&1 \ // RUN: --target=riscv64-unknown-fuchsia -fuse-ld=ld \ // RUN: | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-FUCHSIA-RISCV64 %s // CHECK-SHADOWCALLSTACK-FUCHSIA-RISCV64-NOT: error: +// CHECK-SHADOWCALLSTACK-FUCHSIA-RISCV64: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld" +// CHECK-SHADOWCALLSTACK-FUCHSIA-RISCV64: libclang_rt.builtins.a // RUN: %clang -fsanitize=shadow-call-stack -### %s 2>&1 \ // RUN: --target=aarch64-unknown-linux -fuse-ld=ld -ffixed-x18 \ @@ -896,10 +926,16 @@ // RUN: %clang -fsanitize=shadow-call-stack -### %s 2>&1 \ // RUN: --target=arm64-unknown-ios -fuse-ld=ld \ // RUN: | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18 %s +// CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18-NOT: error: +// CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18: "{{(.*[^-.0-9A-Z_a-z])?}}ld" + // RUN: %clang -fsanitize=shadow-call-stack -### %s 2>&1 \ // RUN: --target=aarch64-unknown-linux-android -fuse-ld=ld \ -// RUN: | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18 %s -// CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18-NOT: error: +// RUN: | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18-ANDROID %s +// CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18-ANDROID-NOT: error: +// CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18-ANDROID: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld" +// CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18-ANDROID: libclang_rt.builtins.a +// CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18-ANDROID: libclang_rt.builtins.a // RUN: not %clang -fsanitize=shadow-call-stack -### %s 2>&1 \ // RUN: --target=x86-unknown-linux -fuse-ld=ld \ @@ -910,13 +946,15 @@ // RUN: -fsanitize=safe-stack --target=x86_64-unknown-linux -fuse-ld=ld \ // RUN: | FileCheck --check-prefix=CHECK-SHADOWCALLSTACK-SAFESTACK %s // CHECK-SHADOWCALLSTACK-SAFESTACK-NOT: error: +// CHECK-SHADOWCALLSTACK-SAFESTACK: "{{(.*[^-.0-9A-Z_a-z])?}}ld" +// CHECK-SHADOWCALLSTACK-SAFESTACK: libclang_rt.safestack.a // RUN: not %clang -fsanitize=cfi -fsanitize-stats -### %s 2>&1 \ // RUN: --target=x86_64-unknown-linux -fuse-ld=ld \ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-CFI-STATS-LINUX %s -// CHECK-CFI-STATS-LINUX: "{{.*}}ld{{(.exe)?}}" +// CHECK-CFI-STATS-LINUX: "{{.*}}ld" // CHECK-CFI-STATS-LINUX: "--whole-archive" "{{[^"]*}}libclang_rt.stats_client.a" "--no-whole-archive" // CHECK-CFI-STATS-LINUX-NOT: "--whole-archive" // CHECK-CFI-STATS-LINUX: "{{[^"]*}}libclang_rt.stats.a" @@ -925,7 +963,7 @@ // RUN: --target=x86_64-apple-darwin -fuse-ld=ld \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-CFI-STATS-DARWIN %s -// CHECK-CFI-STATS-DARWIN: "{{.*}}ld{{(.exe)?}}" +// CHECK-CFI-STATS-DARWIN: "{{.*}}ld" // CHECK-CFI-STATS-DARWIN: "{{[^"]*}}libclang_rt.stats_client_osx.a" // CHECK-CFI-STATS-DARWIN: "{{[^"]*}}libclang_rt.stats_osx_dynamic.dylib" @@ -964,24 +1002,27 @@ // RUN: --sysroot=%S/Inputs/basic_android_tree \ // RUN: | FileCheck --check-prefix=CHECK-SAFESTACK-ANDROID-ARM %s // -// CHECK-SAFESTACK-ANDROID-ARM: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}" -// CHECK-SAFESTACK-ANDROID-ARM-NOT: libclang_rt.safestack +// CHECK-SAFESTACK-ANDROID-ARM: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld" +// CHECK-SAFESTACK-ANDROID-ARM: libclang_rt.builtins.a +// CHECK-SAFESTACK-ANDROID-ARM: libclang_rt.builtins.a // RUN: %clang -### %s -shared 2>&1 \ // RUN: --target=arm-linux-androideabi -fuse-ld=ld -fsanitize=safe-stack \ // RUN: --sysroot=%S/Inputs/basic_android_tree \ // RUN: | FileCheck --check-prefix=CHECK-SAFESTACK-SHARED-ANDROID-ARM %s // -// CHECK-SAFESTACK-SHARED-ANDROID-ARM: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}" -// CHECK-SAFESTACK-SHARED-ANDROID-ARM-NOT: libclang_rt.safestack +// CHECK-SAFESTACK-SHARED-ANDROID-ARM: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld" +// CHECK-SAFESTACK-SHARED-ANDROID-ARM: libclang_rt.builtins.a +// CHECK-SAFESTACK-SHARED-ANDROID-ARM: libclang_rt.builtins.a // RUN: %clang -### %s 2>&1 \ // RUN: --target=aarch64-linux-android -fuse-ld=ld -fsanitize=safe-stack \ // RUN: --sysroot=%S/Inputs/basic_android_tree \ // RUN: | FileCheck --check-prefix=CHECK-SAFESTACK-ANDROID-AARCH64 %s // -// CHECK-SAFESTACK-ANDROID-AARCH64: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}" -// CHECK-SAFESTACK-ANDROID-AARCH64-NOT: libclang_rt.safestack +// CHECK-SAFESTACK-ANDROID-AARCH64: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld" +// CHECK-SAFESTACK-ANDROID-AARCH64: libclang_rt.builtins.a +// CHECK-SAFESTACK-ANDROID-AARCH64: libclang_rt.builtins.a // RUN: not %clang -fsanitize=undefined -### %s 2>&1 \ // RUN: --target=x86_64-scei-ps4 -fuse-ld=ld \ @@ -1054,7 +1095,7 @@ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-SCUDO-LINUX %s -// CHECK-SCUDO-LINUX: "{{.*}}ld{{(.exe)?}}" +// CHECK-SCUDO-LINUX: "{{.*}}ld" // CHECK-SCUDO-LINUX: "--whole-archive" "{{.*}}libclang_rt.scudo_standalone.a" "--no-whole-archive" // CHECK-SCUDO-LINUX-NOT: "-lstdc++" // CHECK-SCUDO-LINUX: "-lpthread" @@ -1067,9 +1108,8 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-SCUDO-SHARED-LINUX %s // -// CHECK-SCUDO-SHARED-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-SCUDO-SHARED-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-SCUDO-SHARED-LINUX-NOT: "-lc" -// CHECK-SCUDO-SHARED-LINUX-NOT: libclang_rt.scudo_standalone.a" // CHECK-SCUDO-SHARED-LINUX: libclang_rt.scudo_standalone.so" // CHECK-SCUDO-SHARED-LINUX-NOT: "-lpthread" // CHECK-SCUDO-SHARED-LINUX-NOT: "-lrt" @@ -1083,7 +1123,7 @@ // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ // RUN: | FileCheck --check-prefix=CHECK-SCUDO-ANDROID %s // -// CHECK-SCUDO-ANDROID: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}" +// CHECK-SCUDO-ANDROID: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld" // CHECK-SCUDO-ANDROID-NOT: "-lc" // CHECK-SCUDO-ANDROID: "-pie" // CHECK-SCUDO-ANDROID-NOT: "-lpthread" @@ -1091,19 +1131,22 @@ // CHECK-SCUDO-ANDROID: libclang_rt.scudo_standalone.so" // CHECK-SCUDO-ANDROID-NOT: "-lpthread" // CHECK-SCUDO-ANDROID-NOT: "-lresolv" +// CHECK-SCUDO-ANDROID: libclang_rt.builtins.a" +// CHECK-SCUDO-ANDROID: libclang_rt.builtins.a" // RUN: %clang -### %s 2>&1 \ // RUN: --target=arm-linux-androideabi -fuse-ld=ld -fsanitize=scudo \ // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ // RUN: -static-libsan \ // RUN: | FileCheck --check-prefix=CHECK-SCUDO-ANDROID-STATIC %s -// CHECK-SCUDO-ANDROID-STATIC: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}" +// CHECK-SCUDO-ANDROID-STATIC: "{{(.*[^.0-9A-Z_a-z])?}}ld.lld" // CHECK-SCUDO-ANDROID-STATIC: "-pie" // CHECK-SCUDO-ANDROID-STATIC: "--whole-archive" "{{.*}}libclang_rt.scudo_standalone.a" "--no-whole-archive" // CHECK-SCUDO-ANDROID-STATIC-NOT: "-lstdc++" // CHECK-SCUDO-ANDROID-STATIC-NOT: "-lpthread" // CHECK-SCUDO-ANDROID-STATIC-NOT: "-lrt" // CHECK-SCUDO-ANDROID-STATIC-NOT: "-lresolv" +// CHECK-SCUDO-ANDROID-STATIC: "{{.*}}libclang_rt.builtins.a" // RUN: %clang -### %s 2>&1 \ // RUN: --target=x86_64-unknown-linux -fuse-ld=ld -fsanitize=hwaddress \ @@ -1111,7 +1154,7 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-HWASAN-X86-64-LINUX %s // -// CHECK-HWASAN-X86-64-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-HWASAN-X86-64-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-HWASAN-X86-64-LINUX-NOT: "-lc" // CHECK-HWASAN-X86-64-LINUX: libclang_rt.hwasan.a" // CHECK-HWASAN-X86-64-LINUX-NOT: "--export-dynamic" @@ -1128,9 +1171,10 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-SHARED-HWASAN-X86-64-LINUX %s // -// CHECK-SHARED-HWASAN-X86-64-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-SHARED-HWASAN-X86-64-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-SHARED-HWASAN-X86-64-LINUX-NOT: "-lc" // CHECK-SHARED-HWASAN-X86-64-LINUX: libclang_rt.hwasan.so" +// CHECK-SHARED-HWASAN-X86-64-LINUX: libclang_rt.hwasan-preinit.a" // CHECK-SHARED-HWASAN-X86-64-LINUX-NOT: "-lpthread" // CHECK-SHARED-HWASAN-X86-64-LINUX-NOT: "-lrt" // CHECK-SHARED-HWASAN-X86-64-LINUX-NOT: "-ldl" @@ -1144,7 +1188,7 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-DSO-SHARED-HWASAN-X86-64-LINUX %s // -// CHECK-DSO-SHARED-HWASAN-X86-64-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-DSO-SHARED-HWASAN-X86-64-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-DSO-SHARED-HWASAN-X86-64-LINUX-NOT: "-lc" // CHECK-DSO-SHARED-HWASAN-X86-64-LINUX: libclang_rt.hwasan.so" // CHECK-DSO-SHARED-HWASAN-X86-64-LINUX-NOT: "-lpthread" @@ -1160,7 +1204,7 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-HWASAN-AARCH64-LINUX %s // -// CHECK-HWASAN-AARCH64-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-HWASAN-AARCH64-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-HWASAN-AARCH64-LINUX-NOT: "-lc" // CHECK-HWASAN-AARCH64-LINUX: libclang_rt.hwasan.a" // CHECK-HWASAN-AARCH64-LINUX-NOT: "--export-dynamic" @@ -1178,9 +1222,10 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-SHARED-HWASAN-AARCH64-LINUX %s // -// CHECK-SHARED-HWASAN-AARCH64-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-SHARED-HWASAN-AARCH64-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-SHARED-HWASAN-AARCH64-LINUX-NOT: "-lc" // CHECK-SHARED-HWASAN-AARCH64-LINUX: libclang_rt.hwasan.so" +// CHECK-SHARED-HWASAN-AARCH64-LINUX: libclang_rt.hwasan-preinit.a" // CHECK-SHARED-HWASAN-AARCH64-LINUX-NOT: "-lpthread" // CHECK-SHARED-HWASAN-AARCH64-LINUX-NOT: "-lrt" // CHECK-SHARED-HWASAN-AARCH64-LINUX-NOT: "-ldl" @@ -1194,7 +1239,7 @@ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | FileCheck --check-prefix=CHECK-DSO-SHARED-HWASAN-AARCH64-LINUX %s // -// CHECK-DSO-SHARED-HWASAN-AARCH64-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +// CHECK-DSO-SHARED-HWASAN-AARCH64-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" // CHECK-DSO-SHARED-HWASAN-AARCH64-LINUX-NOT: "-lc" // CHECK-DSO-SHARED-HWASAN-AARCH64-LINUX: libclang_rt.hwasan.so" // CHECK-DSO-SHARED-HWASAN-AARCH64-LINUX-NOT: "-lpthread" >From 21c0b86eabcccbe9b47c46fd10085a78736a55fd Mon Sep 17 00:00:00 2001 From: Vitaly Buka <vitalyb...@google.com> Date: Thu, 26 Dec 2024 12:36:54 -0800 Subject: [PATCH 2/4] fix quotes Created using spr 1.3.4 --- clang/test/Driver/sanitizer-ld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/test/Driver/sanitizer-ld.c b/clang/test/Driver/sanitizer-ld.c index c7cbd6cf183736..47db2f1f74f75b 100644 --- a/clang/test/Driver/sanitizer-ld.c +++ b/clang/test/Driver/sanitizer-ld.c @@ -1,6 +1,6 @@ // Test sanitizers ld flags. -// DEFINE: %{filecheck} = FileCheck %s --implicit-check-not=\"/libclang_rt\" +// DEFINE: %{filecheck} = FileCheck %s --implicit-check-not="/libclang_rt" // RUN: %clang -### %s 2>&1 \ // RUN: --target=i386-unknown-linux -fuse-ld=ld -fsanitize=address \ >From 507c3a84f60034ef561ad5452e3dd2050f047898 Mon Sep 17 00:00:00 2001 From: Vitaly Buka <vitalyb...@google.com> Date: Thu, 26 Dec 2024 12:40:43 -0800 Subject: [PATCH 3/4] fix CHECK-ASAN-NO-LINK-RUNTIME-DARWIN Created using spr 1.3.4 --- clang/test/Driver/sanitizer-ld.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clang/test/Driver/sanitizer-ld.c b/clang/test/Driver/sanitizer-ld.c index 47db2f1f74f75b..1b2062711db29f 100644 --- a/clang/test/Driver/sanitizer-ld.c +++ b/clang/test/Driver/sanitizer-ld.c @@ -28,14 +28,14 @@ // // CHECK-ASAN-NO-LINK-RUNTIME-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld" -// RUN: %clang -fsanitize=address -fsanitize-link-runtime -### %s 2>&1 \ +// RUN: %clang -fsanitize=address -fno-sanitize-link-runtime -### %s 2>&1 \ // RUN: --target=arm64e-apple-macosx -fuse-ld=ld \ // RUN: -resource-dir=%S/Inputs/resource_dir \ // RUN: --sysroot=%S/Inputs/basic_linux_tree \ // RUN: | %{filecheck} --check-prefix=CHECK-ASAN-NO-LINK-RUNTIME-DARWIN // -// CHECK-ASAN-NO-LINK-RUNTIME-DARWIN: /libclang_rt.asan_osx_dynamic.dylib -// CHECK-ASAN-NO-LINK-RUNTIME-DARWIN: /libclang_rt.osx.a +// CHECK-ASAN-NO-LINK-RUNTIME-DARWIN: "{{.*}}ld" +// CHECK-ASAN-NO-LINK-RUNTIME-DARWIN: /libclang_rt.osx.a" // RUN: %clang -fsanitize=address -### %s 2>&1 \ // RUN: --target=x86_64-unknown-linux -fuse-ld=ld \ >From d236417f475e7ea99d4d2aa2ce972e2047969806 Mon Sep 17 00:00:00 2001 From: Vitaly Buka <vitalyb...@google.com> Date: Thu, 26 Dec 2024 17:55:45 -0800 Subject: [PATCH 4/4] {{(.exe)?}} Created using spr 1.3.4 --- clang/test/Driver/sanitizer-ld.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/test/Driver/sanitizer-ld.c b/clang/test/Driver/sanitizer-ld.c index 0e11aeb0bbd653..91680f47cd5278 100644 --- a/clang/test/Driver/sanitizer-ld.c +++ b/clang/test/Driver/sanitizer-ld.c @@ -909,7 +909,7 @@ // RUN: %clang -target riscv64-linux-android -fsanitize=shadow-call-stack %s -### 2>&1 \ // RUN: | %{filecheck} --check-prefix=CHECK-SHADOWCALLSTACK-ANDROID-RISCV64 // CHECK-SHADOWCALLSTACK-ANDROID-RISCV64-NOT: error: -// CHECK-SHADOWCALLSTACK-ANDROID-RISCV64: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld" +// CHECK-SHADOWCALLSTACK-ANDROID-RISCV64: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}" // CHECK-SHADOWCALLSTACK-ANDROID-RISCV64: libclang_rt.builtins.a // CHECK-SHADOWCALLSTACK-ANDROID-RISCV64: libclang_rt.builtins.a @@ -933,7 +933,7 @@ // RUN: --target=aarch64-unknown-linux-android -fuse-ld=ld \ // RUN: | %{filecheck} --check-prefix=CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18-ANDROID // CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18-ANDROID-NOT: error: -// CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18-ANDROID: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld" +// CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18-ANDROID: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}" // CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18-ANDROID: libclang_rt.builtins.a // CHECK-SHADOWCALLSTACK-LINUX-AARCH64-X18-ANDROID: libclang_rt.builtins.a _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits