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 inline-asm/84742
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.c-torture
/
execute
/
20020503-1.c
blob
6d45ca09af02071cbf0f7990f3df086607a69efb
1
/* PR 6534 */
2
/* GCSE unified the two i<0 tests, but if-conversion to ui=abs(i)
3
insertted the code at the wrong place corrupting the i<0 test. */
4
5
void
abort
(
void
);
6
static char
*
7
inttostr
(
long
i
,
char
buf
[
128
])
8
{
9
unsigned long
ui
=
i
;
10
char
*
p
=
buf
+
127
;
11
*
p
=
'\0'
;
12
if
(
i
<
0
)
13
ui
= -
ui
;
14
do
15
*--
p
=
'0'
+
ui
%
10
;
16
while
((
ui
/=
10
) !=
0
);
17
if
(
i
<
0
)
18
*--
p
=
'-'
;
19
return
p
;
20
}
21
22
int
23
main
()
24
{
25
char
buf
[
128
], *
p
;
26
27
p
=
inttostr
(-
1
,
buf
);
28
if
(*
p
!=
'-'
)
29
abort
();
30
return
0
;
31
}