22 lines · cpp
1/* RUN: %clangxx_msan -O0 %s -o %t && %run %t 2>&12 3 REQUIRES: target={{.*(linux|freebsd).*}}4*/5 6#include <assert.h>7#include <sys/eventfd.h>8 9#include <sanitizer/msan_interface.h>10 11int main(int argc, char *argv[]) {12 int efd = eventfd(42, 0);13 assert(efd >= 0);14 15 eventfd_t v;16 int ret = eventfd_read(efd, &v);17 assert(ret == 0);18 __msan_check_mem_is_initialized(&v, sizeof(v));19 20 assert(v == 42);21}22