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
/
fgets.cpp
blob
6a639f8047db395f7239648a42938d3b22dec09a
1
// RUN: %clangxx -g %s -o %t && %run %t
2
3
#include <assert.h>
4
#include <stdio.h>
5
6
int
main
(
int
argc
,
char
**
argv
) {
7
FILE
*
fp
=
fopen
(
argv
[
0
],
"r"
);
8
assert
(
fp
);
9
10
char
buf
[
2
];
11
char
*
s
=
fgets
(
buf
,
sizeof
(
buf
),
fp
);
12
assert
(
s
);
13
14
assert
(!
fclose
(
fp
));
15
return
0
;
16
}