1 // RUN: %clangxx_msan -DERROR %s -o %t && not %run %t 2>&1 | \
2 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NOCB
3 // RUN: %clangxx_msan -DERROR -DMSANCB_SET %s -o %t && not %run %t 2>&1 | \
4 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-CB
5 // RUN: %clangxx_msan -DERROR -DMSANCB_SET -DMSANCB_CLEAR %s -o %t && not %run %t 2>&1 | \
6 // RUN: FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NOCB
7 // RUN: %clangxx_msan -DMSANCB_SET %s -o %t && %run %t 2>&1 | \
8 // RUN: FileCheck %s --check-prefixes=SUCCEED,CHECK-NOCB
10 #include <sanitizer/msan_interface.h>
15 fprintf(stderr
, "msan-death-callback\n");
18 int main(int argc
, char **argv
) {
19 int *volatile p
= (int *)malloc(sizeof(int));
24 __msan_set_death_callback(cb
);
28 __msan_set_death_callback(0);
35 // CHECK-CB: msan-death-callback
36 // CHECK-NOCB-NOT: msan-death-callback
40 fprintf(stderr
, "done\n");