[OptTable] Fix typo VALUE => VALUES (NFCI) (#121523)
[llvm-project.git] / compiler-rt / test / asan / TestCases / use-after-scope-temp2.cpp
blobb98d6f12911a7808dc22d2bd1c434e9998d3e14d
1 // RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
3 struct IntHolder {
4 __attribute__((noinline)) const IntHolder &Self() const {
5 return *this;
7 int val = 3;
8 };
10 const IntHolder *saved;
12 int main(int argc, char *argv[]) {
13 saved = &IntHolder().Self();
14 int x = saved->val; // BOOM
15 // CHECK: ERROR: AddressSanitizer: stack-use-after-scope
16 // CHECK: #0 0x{{.*}} in main {{.*}}use-after-scope-temp2.cpp:[[@LINE-2]]
17 return x;