repo.or.cz
/
llvm-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git]
/
compiler-rt
/
test
/
sanitizer_common
/
TestCases
/
Posix
/
devname.cpp
blob
8a34de5e31061a409d91007073c136db78f3c3bf
1
// RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s
2
// UNSUPPORTED: target={{.*(linux|solaris).*}}
3
4
#include <assert.h>
5
#include <stdio.h>
6
#include <stdlib.h>
7
#include <sys/stat.h>
8
9
int
main
(
void
) {
10
struct
stat st
;
11
char
*
name
;
12
13
assert
(!
stat
(
"/dev/null"
, &
st
));
14
assert
((
name
=
devname
(
st
.
st_rdev
,
S_ISCHR
(
st
.
st_mode
) ?
S_IFCHR
:
S_IFBLK
)));
15
16
printf
(
"%s
\n
"
,
name
);
17
18
// CHECK: null
19
20
return
0
;
21
}