[compiler-rt] r212959 - [ASan/Win] Add a test for the case when dll_thunk is linked twice to the same DLL
Timur Iskhodzhanov
timurrrr at google.com
Mon Jul 14 10:04:03 PDT 2014
Author: timurrrr
Date: Mon Jul 14 12:04:03 2014
New Revision: 212959
URL: http://llvm.org/viewvc/llvm-project?rev=212959&view=rev
Log:
[ASan/Win] Add a test for the case when dll_thunk is linked twice to the same DLL
This is a test case for r212815.
Added:
compiler-rt/trunk/test/asan/TestCases/Windows/dll_and_lib.cc
Modified:
compiler-rt/trunk/test/asan/lit.cfg
Added: compiler-rt/trunk/test/asan/TestCases/Windows/dll_and_lib.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Windows/dll_and_lib.cc?rev=212959&view=auto
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Windows/dll_and_lib.cc (added)
+++ compiler-rt/trunk/test/asan/TestCases/Windows/dll_and_lib.cc Mon Jul 14 12:04:03 2014
@@ -0,0 +1,18 @@
+// Just make sure we can link an implib into another DLL
+// This used to fail between r212699 and r212814.
+// RUN: %clang_cl_asan -DCONFIG=1 %s -c -Fo%t.1.obj
+// RUN: link /nologo /DLL /OUT:%t.1.dll %t.1.obj %asan_dll_thunk
+// RUN: %clang_cl_asan -DCONFIG=2 %s -c -Fo%t.2.obj
+// RUN: link /nologo /DLL /OUT:%t.2.dll %t.2.obj %t.1.lib %asan_dll_thunk
+
+#if CONFIG==1
+extern "C" __declspec(dllexport) int f1() {
+ int x = 0;
+ return 1;
+}
+#else
+extern "C" __declspec(dllexport) int f2() {
+ int x = 0;
+ return 2;
+}
+#endif
Modified: compiler-rt/trunk/test/asan/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/lit.cfg?rev=212959&r1=212958&r2=212959&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/lit.cfg (original)
+++ compiler-rt/trunk/test/asan/lit.cfg Mon Jul 14 12:04:03 2014
@@ -79,6 +79,8 @@ if platform.system() == 'Windows':
clang_invocation = build_invocation(clang_cl_asan_cxxflags)
clang_cl_invocation = clang_invocation.replace("clang.exe","clang-cl.exe")
config.substitutions.append( ("%clang_cl_asan ", clang_cl_invocation) )
+ config.substitutions.append( ("%asan_dll_thunk",
+ os.path.join(config.compiler_rt_libdir, "clang_rt.asan_dll_thunk-i386.lib")))
# FIXME: De-hardcode this path.
asan_source_dir = os.path.join(
More information about the llvm-commits
mailing list