[Sanitizer] Add rudimentary support for wide-character strings to scanf/printf interc...
[blocksruntime.git] / test / tsan / longjmp2.cc
blob0d551fa19d949d985ec0c1267760394e99f126f9
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>
6 int foo(sigjmp_buf env) {
7 printf("env=%p\n", env);
8 siglongjmp(env, 42);
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;
18 foo(env);
19 printf("FAILED\n");
20 return 0;
23 // CHECK-NOT: FAILED
24 // CHECK: JUMPED