diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc b/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc index 78b9747d8089..e3e9aedce3d6 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc @@ -44,7 +44,7 @@ void SetCommonFlagsDefaults(CommonFlags *f) { f->leak_check_at_exit = true; f->allocator_may_return_null = false; f->print_summary = true; - f->check_printf = false; + f->check_printf = true; // TODO(glider): tools may want to set different defaults for handle_segv. f->handle_segv = SANITIZER_NEEDS_SEGV; f->allow_user_segv_handler = false; diff --git a/compiler-rt/test/asan/TestCases/printf-2.c b/compiler-rt/test/asan/TestCases/printf-2.c index a31d2e56a0da..80137d742981 100644 --- a/compiler-rt/test/asan/TestCases/printf-2.c +++ b/compiler-rt/test/asan/TestCases/printf-2.c @@ -3,7 +3,7 @@ // strlen() and memcpy() called by printf(). // RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=1 not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=0 %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s -// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0 %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s +// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0 not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s #include #include diff --git a/compiler-rt/test/asan/TestCases/printf-3.c b/compiler-rt/test/asan/TestCases/printf-3.c index 12ecc6485c38..79f51fe24de6 100644 --- a/compiler-rt/test/asan/TestCases/printf-3.c +++ b/compiler-rt/test/asan/TestCases/printf-3.c @@ -1,7 +1,7 @@ // RUN: %clang_asan -O2 %s -o %t // RUN: ASAN_OPTIONS=check_printf=1 not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // RUN: ASAN_OPTIONS=check_printf=0 %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s -// RUN: %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s +// RUN: not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s #include int main() { diff --git a/compiler-rt/test/asan/TestCases/printf-4.c b/compiler-rt/test/asan/TestCases/printf-4.c index e93c60ca9391..e5f9c4ed74b9 100644 --- a/compiler-rt/test/asan/TestCases/printf-4.c +++ b/compiler-rt/test/asan/TestCases/printf-4.c @@ -3,7 +3,7 @@ // strlen() and memcpy() called by puts(). // RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=1 not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=0 %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s -// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0 %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s +// RUN: ASAN_OPTIONS=replace_str=0:replace_intrin=0 not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s #include int main() { diff --git a/compiler-rt/test/asan/TestCases/printf-5.c b/compiler-rt/test/asan/TestCases/printf-5.c index 5e90e734fb0f..58f5822569f5 100644 --- a/compiler-rt/test/asan/TestCases/printf-5.c +++ b/compiler-rt/test/asan/TestCases/printf-5.c @@ -2,7 +2,7 @@ // We need replace_intrin=0 to avoid reporting errors in memcpy. // RUN: ASAN_OPTIONS=replace_intrin=0:check_printf=1 not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // RUN: ASAN_OPTIONS=replace_intrin=0:check_printf=0 %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s -// RUN: ASAN_OPTIONS=replace_intrin=0 %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s +// RUN: ASAN_OPTIONS=replace_intrin=0 not %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s #include #include