repo.or.cz
/
blocksruntime.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Move MSan lit-tests under test/msan
[blocksruntime.git]
/
lib
/
asan
/
lit_tests
/
TestCases
/
use-after-scope-nobug.cc
blob
c23acf76eaeefd9aa2adb00ce2a6f37ea1ec99f6
1
// RUN: %clangxx_asan -O0 -fsanitize=use-after-scope %s -o %t && %t
2
3
#include <stdio.h>
4
5
int
main
() {
6
int
*
p
=
0
;
7
// Variable goes in and out of scope.
8
for
(
int
i
=
0
;
i
<
3
;
i
++) {
9
int
x
=
0
;
10
p
= &
x
;
11
}
12
printf
(
"PASSED
\n
"
);
13
return
0
;
14
}