1 | // Test that coverage and MSVC CRT stdio work from a DLL. This ensures that the |
2 | // __local_stdio_printf_options function isn't instrumented for coverage. |
3 | |
4 | // RUN: rm -rf %t && mkdir %t && cd %t |
5 | // RUN: %clang_cl_asan -fsanitize-coverage=func,trace-pc-guard -Od %p/../dll_host.cpp -Fet.exe |
6 | // RUN: %clang_cl_asan -fsanitize-coverage=func,trace-pc-guard -LD -Od %s -Fet.dll |
7 | // RUN: %run ./t.exe t.dll 2>&1 | FileCheck %s |
8 | |
9 | #include <stdio.h> |
10 | |
11 | extern "C" __declspec(dllexport) |
12 | int test_function() { |
13 | printf(format: "hello world\n" ); |
14 | // CHECK: hello world |
15 | return 0; |
16 | } |
17 | |