projects
/
libfirm
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
indentation fixed
[libfirm]
/
ir
/
be
/
test
/
tailrec.c
1
#include <stdio.h>
2
3
static unsigned _fak(unsigned a, unsigned b)
4
{
5
if (a == 0)
6
return b;
7
8
return _fak(a-1, a*b);
9
}
10
11
static fak(unsigned a)
12
{
13
return _fak(a, 1);
14
}
15
16
17
int main(int argc, char *argv[])
18
{
19
int x = 4;
20
21
printf("%d! = %d\n", x, fak(x));
22
23
return 0;
24
}