comparison compiler-rt/test/hwasan/TestCases/use-after-scope-nobug.cpp @ 231:5f20bc1ed4ff

orignal merge with github
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 21 Jul 2021 10:21:57 +0900
parents
children c4bab56944e8
comparison
equal deleted inserted replaced
230:9e61cd3a874d 231:5f20bc1ed4ff
1 // RUN: %clangxx_asan -O1 -fsanitize-address-use-after-scope %s -o %t && %run %t
2 //
3 // Not expected to work yet with HWAsan.
4 // XFAIL: *
5
6 #include <stdio.h>
7 #include <stdlib.h>
8
9 int *p[3];
10
11 int main() {
12 // Variable goes in and out of scope.
13 for (int i = 0; i < 3; i++) {
14 int x;
15 p[i] = &x;
16 }
17 printf("PASSED\n");
18 return 0;
19 }