Home | History | Annotate | Download | only in output_tests
      1 #include <string.h>
      2 int main(int argc, char **argv) {
      3   static char XXX[10];
      4   static char YYY[10];
      5   static char ZZZ[10];
      6   memset(XXX, 0, 10);
      7   memset(YYY, 0, 10);
      8   memset(ZZZ, 0, 10);
      9   int res = YYY[argc * 10];  // BOOOM
     10   // Check-Common: {{READ of size 1 at 0x.* thread T0}}
     11   // Check-Common: {{    #0 0x.* in main .*global-overflow.cc:9}}
     12   // Check-Common: {{0x.* is located 0 bytes to the right of global variable}}
     13   // Check-Common:   {{.*YYY.* of size 10}}
     14   res += XXX[argc] + ZZZ[argc];
     15   return res;
     16 }
     17