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
2018-04-09 Richard Biener <rguenther@suse.de>
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.dg
/
strlenopt-35.c
blob
03b3e13a8e278c510f58b21cd61ef151bdf419b6
1
/* { dg-do run } */
2
/* { dg-options "-O2 -fdump-tree-strlen" } */
3
4
#include
"strlenopt.h"
5
6
volatile
int
v
;
7
8
size_t
9
f1
(
char
*
a1
)
10
{
11
v
+=
1
;
12
size_t
x
=
strlen
(
a1
);
13
char
*
a2
=
a1
+
x
;
14
a2
[
0
] =
'1'
;
15
a2
[
1
] =
'2'
;
16
a2
[
2
] =
'3'
;
17
a2
[
3
] =
0
;
18
return
strlen
(
a1
);
19
}
20
21
int
22
main
()
23
{
24
char
a
[
30
];
25
strcpy
(
a
,
"abcd"
);
26
if
(
f1
(
a
) !=
7
)
27
abort
();
28
return
0
;
29
}
30
31
/* { dg-final { scan-tree-dump-times "strlen \\(" 1 "strlen" } } */