]> git.proxmox.com Git - rustc.git/blame - src/compiler-rt/test/asan/TestCases/use-after-scope-if.cc
New upstream version 1.19.0+dfsg3
[rustc.git] / src / compiler-rt / test / asan / TestCases / use-after-scope-if.cc
CommitLineData
5bcae85e
SL
1// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \
2// RUN: not %run %t 2>&1 | FileCheck %s
3
4int *p;
5bool b = true;
6
7int main() {
8 if (b) {
9 int x[5];
10 p = x+1;
11 }
12 return *p; // BOOM
13 // CHECK: ERROR: AddressSanitizer: stack-use-after-scope
14 // CHECK: #0 0x{{.*}} in main {{.*}}.cc:[[@LINE-2]]
15}