build test/libgroup.so instead of test/libgroup.s
[voodoo-lang.git] / test / fact.voo
blobfc0423dbd789cc2112adfea3f22613f56c787b54
1 #### Factorial in Voodoo
3 section data
5 format:
6 string "%d\n\x00"
8 section functions
9 import printf
10 export main
12 fact:
13 function n
14     ifle n 0
15         return 1
16     end if
17     let m sub n 1
18     set m call fact m
19     return mul n m
20 end function
22 main:
23 function argc argv
24     let n call fact 12
25     call printf format n
26     return 0
27 end function