Debian Codegraph @

compiler-rt/test/sanitizer_common/TestCases/Posix/lstat64.cpp

raw
1 // REQUIRES: linux
2 // RUN: %clangxx -O0 -g %s -o %t && %run %t
3
4 #include <assert.h>
5 #include <stdlib.h>
6 #include <sys/stat.h>
7
8 int main(void) {
9 struct stat64 st;
10
11 assert(!lstat64("/dev/null", &st));
12 #if defined(__sun__) && defined(__svr4__)
13 assert(S_ISLNK(st.st_mode));
14 #else
15 assert(S_ISCHR(st.st_mode));
16 #endif
17
18 return 0;
19 }