1// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
2
3namespace XXX {
4class YYY {
5 public:
6 static char ZZZ[];
7};
8char YYY::ZZZ[] = "abc";
9}
10
11int main(int argc, char **argv) {
12 return (int)XXX::YYY::ZZZ[argc + 5]; // BOOM
13 // CHECK: {{READ of size 1 at 0x.*}}
14 // CHECK: {{0x.* is located 2 bytes after global variable}}
15 // CHECK: '{{.*}}XXX::YYY::ZZZ{{.*}}' {{.*}} of size 4
16 // CHECK: '{{.*}}XXX::YYY::ZZZ{{.*}}' is ascii string 'abc'
17}
18

source code of compiler-rt/test/asan/TestCases/global-demangle.cpp