also remove .s files when running make clean in test directory
[voodoo-lang.git] / test / raw.voo
blobe3b1db5b4fedf8c7167e1932be9c5f018caf58ed
1 #### Test for code not contained in functions
3 section data
5 align
6 result:
7 word 0
9 align
10 format:
11 string "%d\n\x00"
13 section functions
14 import printf
15 export main
17 main:
18 function argc argv
19     goto countdown    
20 done:
21     return 0
22 end function
24 section code
26 print_result:
27 block
28     let x get-word result 0
29     call printf format x
30 end block
31 goto done
33 countdown:
34 block
35     let count 10
36     let temp get-word result 0
37 loop:
38     ifgt count 0
39         set temp add temp 1
40         set count sub count 1
41         goto loop
42     else
43         set-word result 0 temp
44     end if
45 end block
46 goto print_result