diff --git a/compiler-rt/test/sanitizer_common/TestCases/get_allocated_begin.cpp b/compiler-rt/test/sanitizer_common/TestCases/get_allocated_begin.cpp index 5d757eeacd5fc..7ae2df5d5647b 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/get_allocated_begin.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/get_allocated_begin.cpp @@ -25,11 +25,13 @@ int main(void) { // does not unpoison it. const void *start = NULL; for (int j = 0; j < sizes[i]; j++) { - printf("j: %d\n", j); start = __sanitizer_get_allocated_begin(array + j); - printf("Start: %p (expected: %p)\n", start, array); - fflush(stdout); + if (array != start) { + printf("j: %d\n", j); + printf("Start: %p (expected: %p)\n", start, array); + fflush(stdout); + } assert(array == start); }