From 255ee043cbbd6c3af97046e2061cb8bce61b4569 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Thu, 27 Aug 2015 18:05:33 +0000 Subject: [PATCH] Unit test the CRLF change to suppression parsing It's a simpler, faster, and more portable. llvm-svn: 246171 --- .../tests/sanitizer_suppressions_test.cc | 5 +++-- .../TestCases/Windows/suppressions-crlf.cc | 18 ------------------ 2 files changed, 3 insertions(+), 20 deletions(-) delete mode 100644 compiler-rt/test/asan/TestCases/Windows/suppressions-crlf.cc diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_suppressions_test.cc b/compiler-rt/lib/sanitizer_common/tests/sanitizer_suppressions_test.cc index e8c30d07e78c..224ab0538377 100644 --- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_suppressions_test.cc +++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_suppressions_test.cc @@ -105,9 +105,10 @@ TEST_F(SuppressionContextTest, Parse3) { ctx_.Parse( "# last suppression w/o line-feed\n" "race:foo\n" - "race:bar" + "race:bar\r\n" + "race:baz" ); // NOLINT - CheckSuppressions(2, {"race", "race"}, {"foo", "bar"}); + CheckSuppressions(3, {"race", "race", "race"}, {"foo", "bar", "baz"}); } TEST_F(SuppressionContextTest, ParseType) { diff --git a/compiler-rt/test/asan/TestCases/Windows/suppressions-crlf.cc b/compiler-rt/test/asan/TestCases/Windows/suppressions-crlf.cc deleted file mode 100644 index 3b5e4d577783..000000000000 --- a/compiler-rt/test/asan/TestCases/Windows/suppressions-crlf.cc +++ /dev/null @@ -1,18 +0,0 @@ -// Try a strlen suppression, but force the input file to be DOS format (CRLF). -// RUN: %clangxx_asan -O0 %s -o %t -// RUN: python -c 'import sys; sys.stdout.write("interceptor_name:strlen\r\n")' > %t.supp -// RUN: %env_asan_opts=suppressions='"%t.supp"' %run %t 2>&1 | FileCheck %s - -#include -#include -#include - -int main() { - char *a = (char *)malloc(6); - free(a); - size_t len = strlen(a); // BOOM - fprintf(stderr, "strlen ignored, len = %zu\n", len); -} - -// CHECK-NOT: AddressSanitizer: heap-use-after-free -// CHECK: strlen ignored