2016-07-15 05:18:06 +08:00
|
|
|
// RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && %run %t
|
2013-06-06 16:30:26 +08:00
|
|
|
|
|
|
|
#include <stdio.h>
|
2016-04-22 08:10:23 +08:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
int *p[3];
|
2013-06-06 16:30:26 +08:00
|
|
|
|
|
|
|
int main() {
|
|
|
|
// Variable goes in and out of scope.
|
|
|
|
for (int i = 0; i < 3; i++) {
|
2016-04-22 08:10:23 +08:00
|
|
|
int x;
|
|
|
|
p[i] = &x;
|
2013-06-06 16:30:26 +08:00
|
|
|
}
|
|
|
|
printf("PASSED\n");
|
|
|
|
return 0;
|
|
|
|
}
|