repo.or.cz
/
sdcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
struct / union in initializer, RFE #901.
[sdcc.git]
/
sdcc
/
support
/
regression
/
tests
/
bug1717943.c
blob
af653be09a792510227c3426dc8e42020c226d99
1
/*
2
bug1717943c.c
3
an error in the detection of loopinvariants,
4
will move the foo=0 initialisation out of the loops.
5
*/
6
7
#include <testfwk.h>
8
9
char
foo
,
firstcall
;
10
11
char
check
(
void
)
12
{
13
if
(!
firstcall
)
14
return
1
;
15
16
firstcall
=
0
;
17
foo
=
42
;
18
return
0
;
19
}
20
21
void
bug
(
void
)
22
{
23
while
(
1
) {
24
foo
=
0
;
25
while
(
check
())
26
if
(
check
())
27
return
;
28
}
29
}
30
31
32
void
33
testBug
(
void
)
34
{
35
firstcall
=
1
;
36
bug
();
37
ASSERT
(
foo
==
0
);
38
}