Home | History | Annotate | Download | only in lit_tests
      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
     23