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
[ASan/Win] Add a comment about DCL-using-static vs threads
[blocksruntime.git]
/
test
/
msan
/
errno.cc
blob
8af8eb5ee6f9364a193279fea6ca8b0ffe9d027d
1
// RUN: %clangxx_msan -m64 -O0 %s -o %t && %run %t
2
3
#include <assert.h>
4
#include <errno.h>
5
#include <stdio.h>
6
#include <unistd.h>
7
8
int
main
()
9
{
10
int
x
;
11
int
*
volatile
p
= &
x
;
12
errno
= *
p
;
13
int
res
=
read
(-
1
,
0
,
0
);
14
assert
(
res
== -
1
);
15
if
(
errno
)
printf
(
"errno %d
\n
"
,
errno
);
16
return
0
;
17
}