Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / tsan / longjmp2.cpp
blobd396f3fec66e7742eb10bf32ab4d25bbaef32fab
1 // RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <setjmp.h>
7 int foo(sigjmp_buf env) {
8 printf("env=%p\n", env);
9 siglongjmp(env, 42);
12 int main() {
13 sigjmp_buf env;
14 printf("env=%p\n", env);
15 if (sigsetjmp(env, 1) == 42) {
16 fprintf(stderr, "JUMPED\n");
17 return 0;
19 foo(env);
20 fprintf(stderr, "FAILED\n");
21 return 0;
24 // CHECK-NOT: FAILED
25 // CHECK: JUMPED