[OptTable] Fix typo VALUE => VALUES (NFCI) (#121523)
[llvm-project.git] / compiler-rt / test / asan / TestCases / use-after-scope-capture.cpp
blob0eca27181e54f846df28c2f0dc6978c6a7cf4161
1 // RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
3 #include <functional>
5 int main() {
6 std::function<int()> f;
8 int x = 0;
9 f = [&x]() __attribute__((noinline)) {
10 return x; // BOOM
11 // CHECK: ERROR: AddressSanitizer: stack-use-after-scope
12 // We cannot assert the line, after the argument promotion pass this crashes
13 // in the BOOM line below instead, when the ref gets turned into a value.
14 // CHECK: #0 0x{{.*}} in {{.*}}use-after-scope-capture.cpp
17 return f(); // BOOM