Home | History | Annotate | Download | only in TestCases
      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 
      6 namespace XXX {
      7 class YYY {
      8  public:
      9   static char ZZZ[];
     10 };
     11 char YYY::ZZZ[] = "abc";
     12 }
     13 
     14 int 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