[libc] Switch to using the generic `<gpuintrin.h>` implementations (#121810)
[llvm-project.git] / compiler-rt / test / msan / eventfd.cpp
blob638b883fd2c1cca75d3d33b384a24a57c14ca1ef
1 /* RUN: %clangxx_msan -O0 %s -o %t && %run %t 2>&1
3 REQUIRES: target={{.*(linux|freebsd).*}}
4 */
6 #include <assert.h>
7 #include <sys/eventfd.h>
9 #include <sanitizer/msan_interface.h>
11 int main(int argc, char *argv[]) {
12 int efd = eventfd(42, 0);
13 assert(efd >= 0);
15 eventfd_t v;
16 int ret = eventfd_read(efd, &v);
17 assert(ret == 0);
18 __msan_check_mem_is_initialized(&v, sizeof(v));
20 assert(v == 42);