aboutsummaryrefslogtreecommitdiff
path: root/test/asan/TestCases/coverage-reset.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/asan/TestCases/coverage-reset.cc')
-rw-r--r--test/asan/TestCases/coverage-reset.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/asan/TestCases/coverage-reset.cc b/test/asan/TestCases/coverage-reset.cc
index eb8da8c1aa06..11c5ef66ecf6 100644
--- a/test/asan/TestCases/coverage-reset.cc
+++ b/test/asan/TestCases/coverage-reset.cc
@@ -13,6 +13,13 @@ static volatile int sink;
__attribute__((noinline)) void bar() { sink = 2; }
__attribute__((noinline)) void foo() { sink = 1; }
+// In MSVC 2015, printf is an inline function, which causes this test to fail as
+// it introduces an extra coverage point. Define away printf on that platform to
+// avoid the issue.
+#if _MSC_VER >= 1900
+# define printf(arg, ...)
+#endif
+
#define GET_AND_PRINT_COVERAGE() \
bitset = 0; \
for (size_t i = 0; i < n_guards; i++) \