forked from OSchip/llvm-project
Unit test the CRLF change to suppression parsing
It's a simpler, faster, and more portable. llvm-svn: 246171
This commit is contained in:
parent
2588cb93af
commit
255ee043cb
|
@ -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) {
|
||||
|
|
|
@ -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 <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
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
|
Loading…
Reference in New Issue