xref: /llvm-project/compiler-rt/test/asan/TestCases/Windows/msvc/dll_and_lib.cpp (revision 53a81d4d26f0409de8a0655d7af90f2bea222a12)
165abcf6cSAlvin Wong // Just make sure we can link an implib into another DLL
265abcf6cSAlvin Wong // This used to fail between r212699 and r212814.
365abcf6cSAlvin Wong // RUN: %clang_cl_asan -DCONFIG=1 %s -c -Fo%t.1.obj
4*53a81d4dSCharlie Barto // RUN: lld-link /nologo /DLL /OUT:%t.1.dll %t.1.obj %asan_lib %asan_thunk
565abcf6cSAlvin Wong // RUN: %clang_cl_asan -DCONFIG=2 %s -c -Fo%t.2.obj
6*53a81d4dSCharlie Barto // RUN: lld-link /nologo /DLL /OUT:%t.2.dll %t.2.obj %t.1.lib %asan_lib %asan_thunk
765abcf6cSAlvin Wong // REQUIRES: lld-available
865abcf6cSAlvin Wong 
965abcf6cSAlvin Wong #if CONFIG==1
1065abcf6cSAlvin Wong extern "C" __declspec(dllexport) int f1() {
1165abcf6cSAlvin Wong   int x = 0;
1265abcf6cSAlvin Wong   return 1;
1365abcf6cSAlvin Wong }
1465abcf6cSAlvin Wong #else
1565abcf6cSAlvin Wong extern "C" __declspec(dllexport) int f2() {
1665abcf6cSAlvin Wong   int x = 0;
1765abcf6cSAlvin Wong   return 2;
1865abcf6cSAlvin Wong }
1965abcf6cSAlvin Wong #endif
20