1673dc3d4SNico Weber // Build an executable with ASan, then extract the DLLs that it depends on.
2673dc3d4SNico Weber // RUN: %clang_cl_asan %s -Fe%t.exe
3aa3df8ddSFangrui Song // RUN: llvm-readobj --coff-imports %t.exe | grep Name: | sed -e 's/ *Name: *//' > %t
4673dc3d4SNico Weber //
5673dc3d4SNico Weber // Make sure the binary doesn't depend on dbghelp directly.
6673dc3d4SNico Weber // RUN: not grep dbghelp.dll %t
7673dc3d4SNico Weber //
8673dc3d4SNico Weber // Make sure any clang_rt DLLs it depends on don't depend on dbghelp. In the
9673dc3d4SNico Weber // static build, there won't be any clang_rt DLLs.
10673dc3d4SNico Weber // RUN: not grep cl""ang_rt %t || \
11673dc3d4SNico Weber // RUN:   grep cl""ang_rt %t | xargs which | \
12*8f806d5fSFangrui Song // RUN:   xargs llvm-readobj --coff-imports | not grep dbghelp.dll %t
13673dc3d4SNico Weber 
14673dc3d4SNico Weber extern "C" int puts(const char *);
15673dc3d4SNico Weber 
main()16673dc3d4SNico Weber int main() {
17673dc3d4SNico Weber   puts("main");
18673dc3d4SNico Weber }
19