Home | History | Annotate | Download | only in TestCases
      1 // RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
      2 
      3 namespace XXX {
      4 class YYY {
      5  public:
      6   static char ZZZ[];
      7 };
      8 char YYY::ZZZ[] = "abc";
      9 }
     10 
     11 int 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 to the right of global variable}}
     15   // CHECK: 'XXX::YYY::ZZZ' {{.*}} of size 4
     16   // CHECK: 'XXX::YYY::ZZZ' is ascii string 'abc'
     17 }
     18