repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.dg
/
tree-ssa
/
strncpy-1.c
blob
751eaeaf9fc3bcf09e49d786fc7ebdd341585a57
1
/* { dg-do compile } */
2
/* { dg-options "-O -fdump-tree-optimized" } */
3
4
void
sink
(
void
*);
5
6
void
f
(
const char
*
s
)
7
{
8
char
a
[
256
];
9
10
__builtin_memset
(
a
,
0
,
sizeof
a
);
// redundant memset
11
__builtin_strncpy
(
a
,
s
,
sizeof
a
);
12
13
sink
(
a
);
14
}
15
16
/* { dg-final { scan-tree-dump-not "memset" "optimized" } } */