From: Reid Kleckner Date: Fri, 11 Nov 2016 19:27:52 +0000 (+0000) Subject: Add a test that uses coverage and printf from a DLL X-Git-Tag: llvmorg-4.0.0-rc1~4879 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=47dc7f5550e8e01cfa222f19a2e73027c9181dee;p=platform%2Fupstream%2Fllvm.git Add a test that uses coverage and printf from a DLL This test fails without LLVM r286615 llvm-svn: 286618 --- diff --git a/compiler-rt/test/asan/TestCases/Windows/coverage-dll-stdio.cc b/compiler-rt/test/asan/TestCases/Windows/coverage-dll-stdio.cc new file mode 100644 index 0000000..979e80c --- /dev/null +++ b/compiler-rt/test/asan/TestCases/Windows/coverage-dll-stdio.cc @@ -0,0 +1,17 @@ +// 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 -O0 %p/dll_host.cc -Fet.exe +// RUN: %clang_cl_asan -fsanitize-coverage=func -LD -O0 %s -Fet.dll +// RUN: pwd +// RUN: %run ./t.exe t.dll 2>&1 | FileCheck %s + +#include + +extern "C" __declspec(dllexport) +int test_function() { + printf("hello world\n"); + // CHECK: hello world + return 0; +}