Debian Codegraph @

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

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