summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2015-07-17 23:50:08 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2015-07-17 23:50:08 +0000
commite6c614d48a33a067b386d1a4a22bff5db982821e (patch)
tree19b742ad46eafc8ef613536dab8a2f059fc0c71d /compiler-rt/test
parent2e309076f2569bba03931ad72e4f9b106bce3f38 (diff)
downloadbcm5719-llvm-e6c614d48a33a067b386d1a4a22bff5db982821e.tar.gz
bcm5719-llvm-e6c614d48a33a067b386d1a4a22bff5db982821e.zip
[Sanitizer] Teach ReadFileToBuffer to distinguish empty file from inaccessible file.
Summary: This fixes https://code.google.com/p/address-sanitizer/issues/detail?id=399 (sanitizers crash with empty suppression files). Reviewers: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11284 llvm-svn: 242594
Diffstat (limited to 'compiler-rt/test')
-rw-r--r--compiler-rt/test/lsan/TestCases/suppressions_file.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler-rt/test/lsan/TestCases/suppressions_file.cc b/compiler-rt/test/lsan/TestCases/suppressions_file.cc
index d030896d519..805091cba4c 100644
--- a/compiler-rt/test/lsan/TestCases/suppressions_file.cc
+++ b/compiler-rt/test/lsan/TestCases/suppressions_file.cc
@@ -1,6 +1,10 @@
// RUN: LSAN_BASE="use_registers=0:use_stacks=0"
// RUN: %clangxx_lsan %s -o %t
+// RUN: rm -f %t.supp
+// RUN: touch %t.supp
+// RUN: LSAN_OPTIONS="$LSAN_BASE:suppressions='%t.supp'" not %run %t 2>&1 | FileCheck %s --check-prefix=NOSUPP
+
// RUN: echo "leak:*LSanTestLeakingFunc*" > %t.supp
// RUN: LSAN_OPTIONS="$LSAN_BASE:suppressions='%t.supp'" not %run %t 2>&1 | FileCheck %s
@@ -24,3 +28,5 @@ int main() {
// CHECK: Suppressions used:
// CHECK: 1 666 *LSanTestLeakingFunc*
// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s)
+
+// NOSUPP: SUMMARY: {{(Leak|Address)}}Sanitizer: 2003 byte(s) leaked in 2 allocation(s).
OpenPOWER on IntegriCloud