Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / msan / pthread_setcancelstate.cpp
blob087c2223a83d22f50b6647a66c3f59ad1fc48a8c
1 // RUN: %clangxx_msan -O0 %s -o %t && %run %t
3 #include <assert.h>
4 #include <pthread.h>
5 #include <sanitizer/msan_interface.h>
7 int main(void) {
8 int oldstate;
9 int oldtype;
10 int res = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldstate);
11 assert(res == 0);
12 __msan_check_mem_is_initialized(&oldstate, sizeof(oldstate));
14 res = pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);
15 assert(res == 0);
16 __msan_check_mem_is_initialized(&oldtype, sizeof(oldtype));
18 return 0;