xref: /llvm-project/compiler-rt/test/asan/TestCases/Windows/issue64990.cpp (revision db058b954a32dfb164926e407dfcf49bec054216)
1 // Repro for the issue #64990: Asan with Windows EH generates __asan_xxx runtime calls without required funclet tokens
2 // RUN: %clang_cl_asan %Od %s -EHsc %Fe%t
3 // RUN: not %run %t 2>&1 | FileCheck %s
4 
5 // UNSUPPORTED: target={{.*-windows-gnu}}
6 
7 char buff1[6] = "hello";
8 char buff2[6] = "hello";
9 
main(int argc,char ** argv)10 int main(int argc, char **argv) {
11   try {
12     throw 1;
13   } catch (...) {
14     // Make asan generate call to __asan_memcpy inside the EH pad.
15     __builtin_memcpy(buff1, buff2 + 3, 6);
16   }
17   return 0;
18 }
19 // CHECK: #0 {{.*}} in __asan_memcpy
20 // CHECK: SUMMARY: AddressSanitizer: global-buffer-overflow {{.*}} in main
21