1 // RUN: %clangxx_msan -std=c++11 -O0 -g %s -o %t
3 // RUN: not %run %t A_ 2>&1 | FileCheck %s
4 // RUN: not %run %t AH 2>&1 | FileCheck %s
5 // RUN: not %run %t B_ 2>&1 | FileCheck %s
6 // RUN: not %run %t BH 2>&1 | FileCheck %s
7 // RUN: not %run %t C_ 2>&1 | FileCheck %s
8 // RUN: not %run %t CH 2>&1 | FileCheck %s
16 #include <sanitizer/msan_interface.h>
19 void action(int, siginfo_t
*, void *) {}
21 int main(int argc
, char **argv
) {
25 memset(&sa
, 0, sizeof(sa
));
27 sa
.sa_handler
= handler
;
29 sa
.sa_sigaction
= action
;
30 sa
.sa_flags
= SA_SIGINFO
;
35 __msan_poison(&sa
.sa_handler
, sizeof(sa
.sa_handler
));
37 __msan_poison(&sa
.sa_sigaction
, sizeof(sa
.sa_sigaction
));
40 __msan_poison(&sa
.sa_flags
, sizeof(sa
.sa_flags
));
42 __msan_poison(&sa
.sa_mask
, sizeof(sa
.sa_mask
));
43 // CHECK: use-of-uninitialized-value
44 int res
= sigaction(SIGUSR1
, &sa
, nullptr);