19 lines · cpp
1// RUN: %clangxx -O0 -g %s -o %t && %run %t2 3#include <assert.h>4#include <stdlib.h>5#include <sys/stat.h>6 7int 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#else14 assert(S_ISCHR(st.st_mode));15#endif16 17 return 0;18}19