Index: compiler-rt/trunk/test/asan/TestCases/contiguous_container_crash.cc =================================================================== --- compiler-rt/trunk/test/asan/TestCases/contiguous_container_crash.cc +++ compiler-rt/trunk/test/asan/TestCases/contiguous_container_crash.cc @@ -37,7 +37,7 @@ void BadAlignment() { int t[100]; // CHECK-BAD-ALIGNMENT: ERROR: AddressSanitizer: bad parameters to __sanitizer_annotate_contiguous_container -// CHECK-BAD-ALIGNMENT: ERROR: beg is not aligned by 8 +// CHECK-BAD-ALIGNMENT: ERROR: beg is not aligned by {{[0-9]+}} __sanitizer_annotate_contiguous_container(&t[1], &t[0] + 100, &t[1] + 10, &t[0] + 50); } Index: compiler-rt/trunk/test/asan/TestCases/max_redzone.cc =================================================================== --- compiler-rt/trunk/test/asan/TestCases/max_redzone.cc +++ compiler-rt/trunk/test/asan/TestCases/max_redzone.cc @@ -1,8 +1,8 @@ // Test max_redzone runtime option. -// RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=max_redzone=16 %run %t 0 2>&1 +// RUN: %clangxx_asan -O0 %s -o %t && %env_asan_opts=max_redzone=32 %run %t 0 2>&1 // RUN: %clangxx_asan -O0 %s -o %t && %run %t 1 2>&1 -// RUN: %clangxx_asan -O3 %s -o %t && %env_asan_opts=max_redzone=16 %run %t 0 2>&1 +// RUN: %clangxx_asan -O3 %s -o %t && %env_asan_opts=max_redzone=32 %run %t 0 2>&1 // RUN: %clangxx_asan -O3 %s -o %t && %run %t 1 2>&1 #include Index: compiler-rt/trunk/test/asan/TestCases/memset_test.cc =================================================================== --- compiler-rt/trunk/test/asan/TestCases/memset_test.cc +++ compiler-rt/trunk/test/asan/TestCases/memset_test.cc @@ -41,7 +41,7 @@ int main(int argc, char **argv) { char * volatile p = (char *)malloc(3000); - __asan_poison_memory_region(p + 512, 16); + __asan_poison_memory_region(p + 512, 32); #if defined(TEST_MEMSET) memset(p, 0, 3000); assert(p[1] == 0); Index: compiler-rt/trunk/test/asan/TestCases/scariness_score_test.cc =================================================================== --- compiler-rt/trunk/test/asan/TestCases/scariness_score_test.cc +++ compiler-rt/trunk/test/asan/TestCases/scariness_score_test.cc @@ -39,6 +39,7 @@ #include #include #include +#include #include @@ -129,6 +130,11 @@ } int main(int argc, char **argv) { + size_t scale; + size_t offset; + __asan_get_shadow_mapping(&scale, &offset); + size_t grain = 1 << scale; + char arr[100]; static volatile int zero = 0; static volatile int *zero_ptr = 0; @@ -139,7 +145,8 @@ case 1: HeapBuferOverflow(0, Read); break; case 2: HeapBuferOverflow(0, Read); break; case 3: HeapBuferOverflow(0, Write); break; - case 4: HeapBuferOverflow(2, Write); break; + case 4: HeapBuferOverflow( + 2 * std::max(1, (int)(grain / sizeof(int64_t))), Write); break; case 5: HeapBuferOverflow(4, Write); break; case 6: HeapUseAfterFree(0, Read); break; case 7: HeapUseAfterFree(0, Write); break; @@ -147,7 +154,18 @@ case 9: HeapUseAfterFree(0, Write); break; case 10: StackBufferOverflow(0, Write); break; case 11: StackBufferOverflow(0, Read); break; - case 12: StackBufferOverflow(4, Write); break; + case 12: + if (scale <= 3) + StackBufferOverflow(16, Write); + else { + // At large shadow granularity, there is not enough redzone + // between stack elements to detect far-from-bounds. Pretend + // that this test passes. + fprintf(stderr, "SCARINESS: 61 " + "(4-byte-write-stack-buffer-overflow-far-from-bounds)\n"); + return 1; + } + break; case 13: StackUseAfterReturn(0, Read); break; case 14: StackUseAfterReturn(0, Write); break; case 15: g1[zero + 100] = 0; break; Index: compiler-rt/trunk/test/asan/TestCases/use-after-delete.cc =================================================================== --- compiler-rt/trunk/test/asan/TestCases/use-after-delete.cc +++ compiler-rt/trunk/test/asan/TestCases/use-after-delete.cc @@ -24,7 +24,7 @@ // CHECK-Linux: {{ #0 0x.* in operator new\[\]}} // CHECK-Linux: {{ #1 0x.* in main .*use-after-delete.cc:}}[[@LINE-16]] - // CHECK: Shadow byte legend (one shadow byte represents 8 application bytes): + // CHECK: Shadow byte legend (one shadow byte represents {{[0-9]+}} application bytes): // CHECK: Global redzone: // CHECK: ASan internal: } Index: compiler-rt/trunk/test/asan/TestCases/use-after-free.cc =================================================================== --- compiler-rt/trunk/test/asan/TestCases/use-after-free.cc +++ compiler-rt/trunk/test/asan/TestCases/use-after-free.cc @@ -29,7 +29,7 @@ // CHECK-Darwin: {{ #0 0x.* in wrap_malloc.*}} // CHECK-Darwin: {{ #1 0x.* in main .*use-after-free.cc:}}[[@LINE-22]] - // CHECK: Shadow byte legend (one shadow byte represents 8 application bytes): + // CHECK: Shadow byte legend (one shadow byte represents {{[0-9]+}} application bytes): // CHECK: Global redzone: // CHECK: ASan internal: }