global-demangle.cc revision c9424276474a27bd7b6ae59e771371f850a08ba1
1// Don't run through %symbolize to avoid c++filt demangling.
2// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | FileCheck %s
3
4namespace XXX {
5class YYY {
6 public:
7  static int ZZZ[];
8};
9int YYY::ZZZ[] = {0, 1, 2, 3};
10}
11
12int main(int argc, char **argv) {
13  return XXX::YYY::ZZZ[argc + 5];  // BOOM
14  // CHECK: {{READ of size 4 at 0x.*}}
15  // CHECK: {{0x.* is located 8 bytes to the right of global variable}}
16  // CHECK: 'XXX::YYY::ZZZ' {{.*}} of size 16
17}
18