global-demangle.cc revision 2d1fdb26e458c4ddc04155c1d421bced3ba90cd0
12d1fdb26e458c4ddc04155c1d421bced3ba90cd0Stephen Hines// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s 2c9424276474a27bd7b6ae59e771371f850a08ba1Alexey Samsonov 3c9424276474a27bd7b6ae59e771371f850a08ba1Alexey Samsonovnamespace XXX { 4c9424276474a27bd7b6ae59e771371f850a08ba1Alexey Samsonovclass YYY { 5c9424276474a27bd7b6ae59e771371f850a08ba1Alexey Samsonov public: 6939316c822cc46e62684464eecd5cb2cefcf41c5Alexey Samsonov static char ZZZ[]; 7c9424276474a27bd7b6ae59e771371f850a08ba1Alexey Samsonov}; 8939316c822cc46e62684464eecd5cb2cefcf41c5Alexey Samsonovchar YYY::ZZZ[] = "abc"; 9c9424276474a27bd7b6ae59e771371f850a08ba1Alexey Samsonov} 10c9424276474a27bd7b6ae59e771371f850a08ba1Alexey Samsonov 11c9424276474a27bd7b6ae59e771371f850a08ba1Alexey Samsonovint main(int argc, char **argv) { 12939316c822cc46e62684464eecd5cb2cefcf41c5Alexey Samsonov return (int)XXX::YYY::ZZZ[argc + 5]; // BOOM 13939316c822cc46e62684464eecd5cb2cefcf41c5Alexey Samsonov // CHECK: {{READ of size 1 at 0x.*}} 14939316c822cc46e62684464eecd5cb2cefcf41c5Alexey Samsonov // CHECK: {{0x.* is located 2 bytes to the right of global variable}} 15939316c822cc46e62684464eecd5cb2cefcf41c5Alexey Samsonov // CHECK: 'XXX::YYY::ZZZ' {{.*}} of size 4 16939316c822cc46e62684464eecd5cb2cefcf41c5Alexey Samsonov // CHECK: 'XXX::YYY::ZZZ' is ascii string 'abc' 17c9424276474a27bd7b6ae59e771371f850a08ba1Alexey Samsonov} 18