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
/
fgetln.cpp
blob
68b4ad5b887d1ab99c33a3d26a800719e7c2a4fd
1
// RUN: %clangxx -O0 -g %s -o %t && %run %t
2
// fgetln is BSD-only.
3
// UNSUPPORTED: target={{.*(linux|solaris).*}}
4
5
#include <assert.h>
6
#include <stdio.h>
7
#include <stdlib.h>
8
9
int
main
(
void
) {
10
FILE
*
fp
=
fopen
(
"/etc/hosts"
,
"r"
);
11
assert
(
fp
);
12
13
size_t
len
;
14
char
*
s
=
fgetln
(
fp
, &
len
);
15
16
printf
(
"%.*s
\n
"
, (
int
)
len
,
s
);
17
18
assert
(!
fclose
(
fp
));
19
20
return
0
;
21
}