global-demangle.cc revision 5d71de26cedae3dafc17449fe0182045c0bd20e8
1// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=264
2// XFAIL: android
3//
4// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
5
6namespace XXX {
7class YYY {
8 public:
9  static char ZZZ[];
10};
11char YYY::ZZZ[] = "abc";
12}
13
14int main(int argc, char **argv) {
15  return (int)XXX::YYY::ZZZ[argc + 5];  // BOOM
16  // CHECK: {{READ of size 1 at 0x.*}}
17  // CHECK: {{0x.* is located 2 bytes to the right of global variable}}
18  // CHECK: 'XXX::YYY::ZZZ' {{.*}} of size 4
19  // CHECK: 'XXX::YYY::ZZZ' is ascii string 'abc'
20}
21