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
PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.c-torture
/
execute
/
961125-1.c
blob
7fe3dd45422e91f0e30ec3b7ea35419a3610da2e
1
static char
*
2
begfield
(
int
tab
,
char
*
ptr
,
char
*
lim
,
int
sword
,
int
schar
)
3
{
4
if
(
tab
)
5
{
6
while
(
ptr
<
lim
&&
sword
--)
7
{
8
while
(
ptr
<
lim
&& *
ptr
!=
tab
)
9
++
ptr
;
10
if
(
ptr
<
lim
)
11
++
ptr
;
12
}
13
}
14
else
15
{
16
while
(
1
)
17
;
18
}
19
20
if
(
ptr
+
schar
<=
lim
)
21
ptr
+=
schar
;
22
23
return
ptr
;
24
}
25
26
main
()
27
{
28
char
*
s
=
":ab"
;
29
char
*
lim
=
s
+
3
;
30
if
(
begfield
(
':'
,
s
,
lim
,
1
,
1
) !=
s
+
2
)
31
abort
();
32
exit
(
0
);
33
}