android_mt6572_jiabo/external/compiler-rt/test/asan/TestCases/use-after-scope-nobug.cc
2025-09-05 16:56:03 +08:00

15 lines
272 B
C++

// RUN: %clangxx_asan -O0 -fsanitize=use-after-scope %s -o %t && %run %t
// XFAIL: *
#include <stdio.h>
int main() {
int *p = 0;
// Variable goes in and out of scope.
for (int i = 0; i < 3; i++) {
int x = 0;
p = &x;
}
printf("PASSED\n");
return 0;
}