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(sigjmp_buf env) {
      7   printf("env=%p\n", env);
      8   siglongjmp(env, 42);
      9 }
     10 
     11 int main() {
     12   sigjmp_buf env;
     13   printf("env=%p\n", env);
     14   if (sigsetjmp(env, 1) == 42) {
     15     printf("JUMPED\n");
     16     return 0;
     17   }
     18   foo(env);
     19   printf("FAILED\n");
     20   return 0;
     21 }
     22 
     23 // CHECK-NOT: FAILED
     24 // CHECK: JUMPED
     25