]>
git.proxmox.com Git - rustc.git/blob - src/compiler-rt/test/asan/TestCases/Windows/report_globals_reload_dll.cc
1 // Make sure we can handle reloading the same DLL multiple times.
2 // RUN: %clang_cl_asan -LD -O0 -DDLL %s -Fe%t.dll
3 // RUN: %clang_cl_asan -O0 -DEXE %s -Fe%te.exe
4 // RUN: %env_asan_opts=report_globals=1 %run %te.exe %t.dll 2>&1 | FileCheck %s
12 int main(int argc
, char **argv
) {
14 printf("Usage: %s [client].dll\n", argv
[0]);
17 const char *dll_name
= argv
[1];
19 // CHECK: time to load DLL
20 printf("time to load DLL\n");
23 // CHECK: in DLL(reason=1)
24 // CHECK: in DLL(reason=0)
25 // CHECK: in DLL(reason=1)
26 // CHECK: in DLL(reason=0)
27 // CHECK: in DLL(reason=1)
28 // CHECK: in DLL(reason=0)
29 for (int i
= 0; i
< 30; ++i
) {
30 HMODULE dll
= LoadLibrary(dll_name
);
34 if (!FreeLibrary(dll
))
43 BOOL WINAPI
DllMain(HMODULE
, DWORD reason
, LPVOID
) {
44 printf("in DLL(reason=%d)\n", (int)reason
);