projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- fixed comment: bs cannot be NULL anymore (and was never NULL previously)
[libfirm]
/
ir
/
be
/
test
/
fib.c
diff --git
a/ir/be/test/fib.c
b/ir/be/test/fib.c
index
a11e94f
..
6b5e480
100644
(file)
--- a/
ir/be/test/fib.c
+++ b/
ir/be/test/fib.c
@@
-2,10
+2,12
@@
unsigned fib(unsigned n)
{
unsigned fib(unsigned n)
{
- if(n == 0)
+ if(n == 0)
{
return 0;
return 0;
- if(n == 1)
+ }
+ if(n == 1) {
return 1;
return 1;
+ }
return fib(n-1) + fib(n-2);
}
return fib(n-1) + fib(n-2);
}
@@
-15,7
+17,13
@@
int main(int argc, char** argv) {
if(argc > 1)
n = (unsigned) atoi(argv[1]);
if(argc > 1)
n = (unsigned) atoi(argv[1]);
+#ifdef COUNT_BRANCHES
+ b1 = b2 = b3 = 0;
+#endif
printf("Fib %u: %u\n", n, fib(n));
printf("Fib %u: %u\n", n, fib(n));
+#ifdef COUNT_BRANCHES
+ printf("Branches: 1:%d 2:%d 3:%d\n", b1, b2, b3);
+#endif
return 0;
}
return 0;
}