Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / msan / Linux / sigandorset.cpp
blobda983020a4c6897ac972452f6ecee0ab1a660fc4
1 // RUN: %clangxx_msan -std=c++11 -O0 -g %s -o %t && not %run %t 2>&1 | FileCheck %s
2 // RUN: %clangxx_msan -DLEFT_OK -std=c++11 -O0 -g %s -o %t && not %run %t 2>&1 | FileCheck %s
3 // RUN: %clangxx_msan -DRIGHT_OK -std=c++11 -O0 -g %s -o %t && not %run %t 2<&1 | FileCheck %s
4 // RUN: %clangxx_msan -DLEFT_OK -DRIGHT_OK -std=c++11 -O0 -g %s -o %t && %run %t
5 // REQUIRES: !android
7 #include <assert.h>
8 #include <sanitizer/msan_interface.h>
9 #include <signal.h>
10 #include <sys/time.h>
11 #include <unistd.h>
13 int main(void) {
14 sigset_t s, t, u;
15 #ifdef LEFT_OK
16 sigemptyset(&t);
17 #endif
18 #ifdef RIGHT_OK
19 sigemptyset(&u);
20 #endif
22 // CHECK: MemorySanitizer: use-of-uninitialized-value
23 // CHECK-NEXT: in main {{.*}}sigandorset.cpp:[[@LINE+1]]
24 sigandset(&s, &t, &u);
25 sigorset(&s, &t, &u);
26 __msan_check_mem_is_initialized(&s, sizeof s);
27 return 0;