xref: /llvm-project/compiler-rt/test/asan/TestCases/Windows/msvc/gz.cpp (revision 1822bc15cb378458e942e405ae7da32ee75b8c5b)
1 // Make sure that ASan works with non-cdecl default calling conventions.
2 // Many x86 projects pass `/Gz` to their compiles, so that __stdcall is the default,
3 // but LLVM is built with __cdecl.
4 //
5 // RUN: %clang_cl_asan -Gz %Od %s %Fe%t
6 
7 // includes a declaration of `_ReturnAddress`
8 #include <intrin.h>
9 
10 #include <sanitizer/asan_interface.h>
11 
main()12 int main() {
13   alignas(8) char buffer[8];
14   __asan_poison_memory_region(buffer, sizeof buffer);
15 }
16