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
Corrected date in changelog
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.dg
/
strcmpopt_1.c
blob
40596a20b40088d643ccc0a4f60e5cf5005a8a2b
1
/* { dg-do run } */
2
/* { dg-options "-fdump-tree-gimple" } */
3
4
#include <string.h>
5
#include <stdlib.h>
6
7
int
cmp1
(
char
*
p
)
8
{
9
return
strncmp
(
p
,
"fis"
,
4
);
10
}
11
int
cmp2
(
char
*
q
)
12
{
13
return
strncmp
(
"fis"
,
q
,
4
);
14
}
15
16
int
main
()
17
{
18
19
char
*
p
=
"fish"
;
20
char
*
q
=
"fis\0"
;
21
22
if
(
cmp1
(
p
) ==
0
||
cmp2
(
q
) !=
0
)
23
abort
();
24
25
return
0
;
26
}
27
28
/* { dg-final { scan-tree-dump-times "strcmp \\(" 2 "gimple" } } */