Files
clang-p2996/compiler-rt/test/asan/TestCases/Windows/msvc/gz.cpp
nicole mazzuca 1822bc15cb Remove __cdecl from _ReturnAddress (#72919)
As an intrinsic, `_ReturnAddress` does not need it; additionally,
if someone else declares `_ReturnAddress` without `__cdecl` (for
example, `<intrin.h>`)

Additionally, actually add a test for this change. I've tested it
locally with both LLVM and MSVC.
2023-11-22 10:11:09 -08:00

16 lines
441 B
C++

// Make sure that ASan works with non-cdecl default calling conventions.
// Many x86 projects pass `/Gz` to their compiles, so that __stdcall is the default,
// but LLVM is built with __cdecl.
//
// RUN: %clang_cl_asan -Gz %Od %s %Fe%t
// includes a declaration of `_ReturnAddress`
#include <intrin.h>
#include <sanitizer/asan_interface.h>
int main() {
alignas(8) char buffer[8];
__asan_poison_memory_region(buffer, sizeof buffer);
}