blob: 087c2223a83d22f50b6647a66c3f59ad1fc48a8c [file] [log] [blame]
Pirama Arumuga Nainar799172d2016-03-03 15:50:30 -08001// RUN: %clangxx_msan -O0 %s -o %t && %run %t
2
3#include <assert.h>
4#include <pthread.h>
5#include <sanitizer/msan_interface.h>
6
7int 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));
13
14 res = pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);
15 assert(res == 0);
16 __msan_check_mem_is_initialized(&oldtype, sizeof(oldtype));
17
18 return 0;
19}