Home | History | Annotate | Download | only in TestCases
      1 // RUN: %clangxx_asan -O0 -fsanitize=use-after-scope %s -o %t && %t
      2 
      3 #include <stdio.h>
      4 
      5 int main() {
      6   int *p = 0;
      7   // Variable goes in and out of scope.
      8   for (int i = 0; i < 3; i++) {
      9     int x = 0;
     10     p = &x;
     11   }
     12   printf("PASSED\n");
     13   return 0;
     14 }
     15