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