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
[Sanitizer] Add rudimentary support for wide-character strings to scanf/printf interc...
[blocksruntime.git]
/
test
/
tsan
/
longjmp.cc
blob
d9ca4ca5e6e9d59623631e9d1e11132bc01ebfa5
1
// RUN: %clang_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s
2
#include <stdio.h>
3
#include <stdlib.h>
4
#include <setjmp.h>
5
6
int
foo
(
jmp_buf
env
) {
7
longjmp
(
env
,
42
);
8
}
9
10
int
main
() {
11
jmp_buf
env
;
12
if
(
setjmp
(
env
) ==
42
) {
13
printf
(
"JUMPED
\n
"
);
14
return
0
;
15
}
16
foo
(
env
);
17
printf
(
"FAILED
\n
"
);
18
return
0
;
19
}
20
21
// CHECK-NOT: FAILED
22
// CHECK: JUMPED