[compiler-rt] r286618 - Add a test that uses coverage and printf from a DLL

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 11 11:27:53 PST 2016


Author: rnk
Date: Fri Nov 11 13:27:52 2016
New Revision: 286618

URL: http://llvm.org/viewvc/llvm-project?rev=286618&view=rev
Log:
Add a test that uses coverage and printf from a DLL

This test fails without LLVM r286615

Added:
    compiler-rt/trunk/test/asan/TestCases/Windows/coverage-dll-stdio.cc

Added: compiler-rt/trunk/test/asan/TestCases/Windows/coverage-dll-stdio.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Windows/coverage-dll-stdio.cc?rev=286618&view=auto
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Windows/coverage-dll-stdio.cc (added)
+++ compiler-rt/trunk/test/asan/TestCases/Windows/coverage-dll-stdio.cc Fri Nov 11 13:27:52 2016
@@ -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 <stdio.h>
+
+extern "C" __declspec(dllexport)
+int test_function() {
+  printf("hello world\n");
+  // CHECK: hello world
+  return 0;
+}




More information about the llvm-commits mailing list