repo.or.cz
/
llvm-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git]
/
compiler-rt
/
test
/
msan
/
sem_getvalue.cpp
blob
07b95cd493a2951117a998403b995b262cb8cd8e
1
// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t
2
3
#include <assert.h>
4
#include <sanitizer/msan_interface.h>
5
#include <semaphore.h>
6
7
int
main
(
void
) {
8
sem_t sem
;
9
int
res
=
sem_init
(&
sem
,
0
,
42
);
10
assert
(
res
==
0
);
11
12
int
v
;
13
res
=
sem_getvalue
(&
sem
, &
v
);
14
assert
(
res
==
0
);
15
__msan_check_mem_is_initialized
(&
v
,
sizeof
(
v
));
16
assert
(
v
==
42
);
17
18
res
=
sem_destroy
(&
sem
);
19
assert
(
res
==
0
);
20
21
return
0
;
22
}