Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / tsan / longjmp.cpp
bloba8abca6017586f4ed2ee54bdfedb229dbf53bfa0
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(jmp_buf env) {
8 longjmp(env, 42);
11 int main() {
12 jmp_buf env;
13 if (setjmp(env) == 42) {
14 fprintf(stderr, "JUMPED\n");
15 return 0;
17 foo(env);
18 fprintf(stderr, "FAILED\n");
19 return 0;
22 // CHECK-NOT: FAILED
23 // CHECK: JUMPED