xref: /llvm-project/compiler-rt/test/msan/fstatat64.cpp (revision 1f82d0f795d11376adf3e62fc35fd98bb46e82b0)
1 // REQUIRES: linux
2 // RUN: %clangxx_msan -O0 %s -o %t && %run %t
3 
4 #include <cassert>
5 #include <cstdlib>
6 #include <fcntl.h>
7 #include <sys/stat.h>
8 
main(void)9 int main(void) {
10   struct stat64 st;
11   int dirfd = open("/dev", O_RDONLY);
12   if (fstatat64(dirfd, "null", &st, 0))
13     exit(1);
14 
15   assert(S_ISCHR(st.st_mode));
16 
17   return 0;
18 }
19