1 // This is the ASAN test of the same name ported to HWAsan.
2 
3 // RUN: %clangxx_hwasan -mllvm -hwasan-use-after-scope -O1 %s -o %t && %run %t
4 
5 // REQUIRES: aarch64-target-arch
6 // REQUIRES: stable-runtime
7 
8 #include <stdio.h>
9 #include <stdlib.h>
10 
11 int *p[3];
12 
main()13 int main() {
14   // Variable goes in and out of scope.
15   for (int i = 0; i < 3; i++) {
16     int x;
17     p[i] = &x;
18   }
19   printf("PASSED\n");
20   return 0;
21 }
22