diff --git a/compiler-rt/test/asan/TestCases/use-after-scope-capture.cpp b/compiler-rt/test/asan/TestCases/use-after-scope-capture.cpp --- a/compiler-rt/test/asan/TestCases/use-after-scope-capture.cpp +++ b/compiler-rt/test/asan/TestCases/use-after-scope-capture.cpp @@ -1,13 +1,20 @@ // RUN: %clangxx_asan %stdcxx11 -O1 -fsanitize-address-use-after-scope %s -o %t && \ // RUN: not %run %t 2>&1 | FileCheck %s +// TODO(https://bugs.llvm.org/show_bug.cgi?id=46208): remove once Windows/inlining/lambda symbolization issues are resolved +#ifdef _WIN32 +#define ATTR __attribute__((noinline)) +#else +#define ATTR +#endif + #include int main() { std::function f; { int x = 0; - f = [&x]() { + f = [&x]() ATTR { return x; // BOOM // CHECK: ERROR: AddressSanitizer: stack-use-after-scope // CHECK: #0 0x{{.*}} in {{.*}}use-after-scope-capture.cpp:[[@LINE-2]]