aboutsummaryrefslogtreecommitdiff
path: root/test/asan/TestCases/use-after-scope-chars.cc
blob: 51fc5fa38747459072f02a6e65e83d3158cf79d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && \
// RUN:     not %run %t 2>&1 | FileCheck %s
// XFAIL: *

// FIXME: This works only for arraysize <= 8.

char *p = 0;

int main() {
  {
    char x[1024] = {};
    p = x;
  }
  return *p;  // BOOM
}