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
/
tsan
/
suppress_same_address.cc
blob
c1721409a5e027c828935356ff9d08cf1c43009e
1
// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
2
#include <pthread.h>
3
#include <unistd.h>
4
5
volatile
int
X
;
6
7
void
*
Thread1
(
void
*
x
) {
8
sleep
(
1
);
9
X
=
42
;
10
X
=
66
;
11
X
=
78
;
12
return
0
;
13
}
14
15
void
*
Thread2
(
void
*
x
) {
16
X
=
11
;
17
X
=
99
;
18
X
=
73
;
19
return
0
;
20
}
21
22
int
main
() {
23
pthread_t t
;
24
pthread_create
(&
t
,
0
,
Thread1
,
0
);
25
Thread2
(
0
);
26
pthread_join
(
t
,
0
);
27
}
28
29
// CHECK: ThreadSanitizer: reported 1 warnings