summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/asan/TestCases/Windows/coverage-dll-stdio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/test/asan/TestCases/Windows/coverage-dll-stdio.cpp')
-rw-r--r--compiler-rt/test/asan/TestCases/Windows/coverage-dll-stdio.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler-rt/test/asan/TestCases/Windows/coverage-dll-stdio.cpp b/compiler-rt/test/asan/TestCases/Windows/coverage-dll-stdio.cpp
new file mode 100644
index 00000000000..f2bfaad28a1
--- /dev/null
+++ b/compiler-rt/test/asan/TestCases/Windows/coverage-dll-stdio.cpp
@@ -0,0 +1,16 @@
+// Test that coverage and MSVC CRT stdio work from a DLL. This ensures that the
+// __local_stdio_printf_options function isn't instrumented for coverage.
+
+// RUN: rm -rf %t && mkdir %t && cd %t
+// RUN: %clang_cl_asan -fsanitize-coverage=func,trace-pc-guard -Od %p/dll_host.cpp -Fet.exe
+// RUN: %clang_cl_asan -fsanitize-coverage=func,trace-pc-guard -LD -Od %s -Fet.dll
+// RUN: %run ./t.exe t.dll 2>&1 | FileCheck %s
+
+#include <stdio.h>
+
+extern "C" __declspec(dllexport)
+int test_function() {
+ printf("hello world\n");
+ // CHECK: hello world
+ return 0;
+}
OpenPOWER on IntegriCloud