Skip to content
Snippets Groups Projects
Commit 55d29281 authored by Evgeniy Stepanov's avatar Evgeniy Stepanov
Browse files

Fix linking of DFSan + coverage.

Broken in r272717 because of no test coverage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272853 91177308-0d34-0410-b5e6-96231b3b80d8
parent 93fc6c4d
No related branches found
No related tags found
No related merge requests found
...@@ -162,7 +162,7 @@ bool SanitizerArgs::needsUbsanRt() const { ...@@ -162,7 +162,7 @@ bool SanitizerArgs::needsUbsanRt() const {
return ((Sanitizers.Mask & NeedsUbsanRt & ~TrapSanitizers.Mask) || return ((Sanitizers.Mask & NeedsUbsanRt & ~TrapSanitizers.Mask) ||
CoverageFeatures) && CoverageFeatures) &&
!Sanitizers.has(Address) && !Sanitizers.has(Memory) && !Sanitizers.has(Address) && !Sanitizers.has(Memory) &&
!Sanitizers.has(Thread) && !CfiCrossDso; !Sanitizers.has(Thread) && !Sanitizers.has(DataFlow) && !CfiCrossDso;
} }
bool SanitizerArgs::needsCfiRt() const { bool SanitizerArgs::needsCfiRt() const {
......
...@@ -293,6 +293,61 @@ ...@@ -293,6 +293,61 @@
// CHECK-LSAN-ASAN-LINUX: libclang_rt.asan-x86_64 // CHECK-LSAN-ASAN-LINUX: libclang_rt.asan-x86_64
// CHECK-LSAN-ASAN-LINUX-NOT: libclang_rt.lsan // CHECK-LSAN-ASAN-LINUX-NOT: libclang_rt.lsan
// RUN: %clang -fsanitize=address -fsanitize-coverage=func %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-unknown-linux \
// 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-x86_64.a" "-no-whole-archive"
// CHECK-ASAN-COV-LINUX: "--dynamic-list={{.*}}libclang_rt.asan-x86_64.a.syms"
// CHECK-ASAN-COV-LINUX-NOT: libclang_rt.ubsan
// CHECK-ASAN-COV-LINUX-NOT: "-lstdc++"
// CHECK-ASAN-COV-LINUX: "-lpthread"
// RUN: %clang -fsanitize=memory -fsanitize-coverage=func %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-unknown-linux \
// 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: "-whole-archive" "{{.*}}libclang_rt.msan-x86_64.a" "-no-whole-archive"
// CHECK-MSAN-COV-LINUX: "--dynamic-list={{.*}}libclang_rt.msan-x86_64.a.syms"
// CHECK-MSAN-COV-LINUX-NOT: libclang_rt.ubsan
// CHECK-MSAN-COV-LINUX-NOT: "-lstdc++"
// CHECK-MSAN-COV-LINUX: "-lpthread"
// RUN: %clang -fsanitize=dataflow -fsanitize-coverage=func %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-unknown-linux \
// 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: "-whole-archive" "{{.*}}libclang_rt.dfsan-x86_64.a" "-no-whole-archive"
// CHECK-DFSAN-COV-LINUX: "--dynamic-list={{.*}}libclang_rt.dfsan-x86_64.a.syms"
// CHECK-DFSAN-COV-LINUX-NOT: libclang_rt.ubsan
// CHECK-DFSAN-COV-LINUX-NOT: "-lstdc++"
// CHECK-DFSAN-COV-LINUX: "-lpthread"
// RUN: %clang -fsanitize=undefined -fsanitize-coverage=func %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-unknown-linux \
// 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: "-whole-archive" "{{.*}}libclang_rt.ubsan_standalone-x86_64.a" "-no-whole-archive"
// CHECK-UBSAN-COV-LINUX: "--dynamic-list={{.*}}libclang_rt.ubsan_standalone-x86_64.a.syms"
// CHECK-UBSAN-COV-LINUX-NOT: libclang_rt.ubsan
// CHECK-UBSAN-COV-LINUX-NOT: "-lstdc++"
// CHECK-UBSAN-COV-LINUX: "-lpthread"
// RUN: %clang -fsanitize-coverage=func %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-unknown-linux \
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
// RUN: | FileCheck --check-prefix=CHECK-COV-LINUX %s
// CHECK-COV-LINUX: "{{.*}}ld{{(.exe)?}}"
// CHECK-COV-LINUX: "-whole-archive" "{{.*}}libclang_rt.ubsan_standalone-x86_64.a" "-no-whole-archive"
// CHECK-COV-LINUX: "--dynamic-list={{.*}}libclang_rt.ubsan_standalone-x86_64.a.syms"
// CHECK-COV-LINUX-NOT: libclang_rt.ubsan
// CHECK-COV-LINUX-NOT: "-lstdc++"
// CHECK-COV-LINUX: "-lpthread"
// CFI by itself does not link runtime libraries. // CFI by itself does not link runtime libraries.
// RUN: %clang -fsanitize=cfi %s -### -o %t.o 2>&1 \ // RUN: %clang -fsanitize=cfi %s -### -o %t.o 2>&1 \
// RUN: -target x86_64-unknown-linux \ // RUN: -target x86_64-unknown-linux \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment