bolt/deps/llvm-18.1.8/compiler-rt/test/msan/fstatat64.cpp

19 lines
321 B
C++
Raw Normal View History

2025-02-14 19:21:04 +01:00
// REQUIRES: linux
// RUN: %clangxx_msan -O0 %s -o %t && %run %t
#include <cassert>
#include <cstdlib>
#include <fcntl.h>
#include <sys/stat.h>
int main(void) {
struct stat64 st;
int dirfd = open("/dev", O_RDONLY);
if (fstatat64(dirfd, "null", &st, 0))
exit(1);
assert(S_ISCHR(st.st_mode));
return 0;
}