]> git.proxmox.com Git - rustc.git/blob - src/compiler-rt/test/asan/TestCases/use-after-scope-nobug.cc
Imported Upstream version 1.6.0+dfsg1
[rustc.git] / src / compiler-rt / test / asan / TestCases / use-after-scope-nobug.cc
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 }