summaryrefslogtreecommitdiff
path: root/test/sanitizer_common
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2017-05-03 18:38:34 +0000
committerKostya Serebryany <kcc@google.com>2017-05-03 18:38:34 +0000
commit72830dd7ffe3932beb5f5fbe29d84105b7df3f8a (patch)
tree4176c740c2a4af6886bd377b694da5e3d7d7cf5b /test/sanitizer_common
parent4e8f70074eb0b1b8612f770d269791afaac38f74 (diff)
[asan] print the 'unexpected format specifier in printf interceptor' warning just once (came up in https://github.com/google/oss-fuzz/pull/562). Not touching a similar scanf warning -- for some reason it does not fire for me.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@302064 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/sanitizer_common')
-rw-r--r--test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cc b/test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cc
new file mode 100644
index 000000000..f48cce8ea
--- /dev/null
+++ b/test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cc
@@ -0,0 +1,12 @@
+// RUN: %clang -w -O0 %s -o %t && %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: lsan
+// UNSUPPORTED: msan
+#include <stdio.h>
+int main() {
+ int a;
+ printf("%Q\n", 1);
+ printf("%Q\n", 1);
+ printf("%Q\n", 1);
+}
+// CHECK: unexpected format specifier in printf interceptor: %Q (reported once per process)
+// CHECK-NOT: unexpected format specifier in printf interceptor