Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / sanitizer_common / TestCases / Posix / devname.cpp
blob8a34de5e31061a409d91007073c136db78f3c3bf
1 // RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s
2 // UNSUPPORTED: target={{.*(linux|solaris).*}}
4 #include <assert.h>
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <sys/stat.h>
9 int main(void) {
10 struct stat st;
11 char *name;
13 assert(!stat("/dev/null", &st));
14 assert((name = devname(st.st_rdev, S_ISCHR(st.st_mode) ? S_IFCHR : S_IFBLK)));
16 printf("%s\n", name);
18 // CHECK: null
20 return 0;