[compiler-rt] r285004 - [asan] relax strstr tests.
Tim Northover via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 24 12:07:27 PDT 2016
Author: tnorthover
Date: Mon Oct 24 14:07:27 2016
New Revision: 285004
URL: http://llvm.org/viewvc/llvm-project?rev=285004&view=rev
Log:
[asan] relax strstr tests.
Darwin's implementation of strstr seems to trigger slightly different failure
modes from Linux since it calls strncmp. All messages seem about equally useful
and correct, so I relaxed the tests so Darwin can pass.
Modified:
compiler-rt/trunk/test/asan/TestCases/strstr-1.c
compiler-rt/trunk/test/asan/TestCases/strstr_strict.c
Modified: compiler-rt/trunk/test/asan/TestCases/strstr-1.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/strstr-1.c?rev=285004&r1=285003&r2=285004&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/strstr-1.c (original)
+++ compiler-rt/trunk/test/asan/TestCases/strstr-1.c Mon Oct 24 14:07:27 2016
@@ -15,7 +15,7 @@ int main(int argc, char **argv) {
char s1[4] = "acb";
__asan_poison_memory_region ((char *)&s1[2], 2);
r = strstr(s1, s2);
- // CHECK:'s1' <== Memory access at offset {{[0-9]+}} partially overflows this variable
+ // CHECK:'s1' <== Memory access at offset {{[0-9]+}} {{partially overflows this variable|is inside this variable}}
assert(r == s1 + 1);
return 0;
}
Modified: compiler-rt/trunk/test/asan/TestCases/strstr_strict.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/strstr_strict.c?rev=285004&r1=285003&r2=285004&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/strstr_strict.c (original)
+++ compiler-rt/trunk/test/asan/TestCases/strstr_strict.c Mon Oct 24 14:07:27 2016
@@ -17,7 +17,7 @@ int main(int argc, char **argv) {
s2[size - 1]='\0';
char* r = strstr(s1, s2);
// CHECK: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}}
- // CHECK: READ of size 101
+ // CHECK: READ of size {{101|100}}
assert(r == s1);
free(s1);
free(s2);
More information about the llvm-commits
mailing list