Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
daadfb78
Commit
daadfb78
authored
Aug 22, 2007
by
Matthias Braun
Browse files
improved version of fehler71
[r15580]
parent
62ca7f0e
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/test/fehler71.c
View file @
daadfb78
/*$ -fno-if-conv $*/
/*$ -fno-if-conv
-fno-inline
$*/
#include
<stdio.h>
#include
<stdlib.h>
int
a
=
42
;
void
changea
(
void
)
{
int
changea
(
void
)
{
a
=
13
;
return
1
;
}
int
f2
(
void
)
{
int
t
=
a
;
int
t2
=
changea
();
changea
();
changea
();
int
t3
=
t
+
t2
;
changea
();
return
t3
;
}
int
f
(
int
f
)
{
int
t
=
a
;
changea
();
/* must not use source address mode (loading from a) for t+1
and t+2
*/
/* must not use source address mode (loading from a) for t+1 */
if
(
f
>
10000
)
{
return
t
+
1
;
}
...
...
@@ -22,6 +33,8 @@ int f(int f) {
int
main
(
void
)
{
srand
(
0
);
printf
(
"Res: %d
\n
"
,
f
(
rand
()));
printf
(
"Res: %d (should be 43)
\n
"
,
f
(
1000000
));
a
=
42
;
printf
(
"Res2: %d (should be 43)
\n
"
,
f2
());
return
0
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment