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
/
tsan
/
longjmp.cpp
blob
a8abca6017586f4ed2ee54bdfedb229dbf53bfa0
1
// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
2
3
#include <stdio.h>
4
#include <stdlib.h>
5
#include <setjmp.h>
6
7
int
foo
(
jmp_buf
env
) {
8
longjmp
(
env
,
42
);
9
}
10
11
int
main
() {
12
jmp_buf
env
;
13
if
(
setjmp
(
env
) ==
42
) {
14
fprintf
(
stderr
,
"JUMPED
\n
"
);
15
return
0
;
16
}
17
foo
(
env
);
18
fprintf
(
stderr
,
"FAILED
\n
"
);
19
return
0
;
20
}
21
22
// CHECK-NOT: FAILED
23
// CHECK: JUMPED