Added test case for auto-words and made it pass on amd64 and i386.
[voodoo-lang.git] / test / else-if.voo
bloba0b8d2273acefcd2d939bb7c52d7d602c84672b2
1 #### Test program for chained if statements
4 section data
6 align
7 equal:
8 string "%d is equal to %d\n\x00"
10 align
11 greater_than:
12 string "%d is greater than %d\n\x00"
14 align
15 less_than:
16 string "%d is less than %d\n\x00"
19 section functions
21 import printf
22 export main
24 align
25 main:
26 function argc argv
27     let x -1
28     let y 0
29     let z 1
31     iflt x y
32         call printf less_than x y
33     else ifeq x y
34         call printf equal x y
35     else
36         call printf greater_than x y
37     end if
39     ifgt y z
40         call printf greater_than y z
41     else ifeq y z
42         call printf equal y z
43     else
44         call printf less_than y z
45     end if
47     iflt y y
48         call printf less_than y y
49     else ifeq y y
50         call printf equal y y
51     else
52         call printf greater_than y y
53     end if
55     return 0
56 end function