set version to 1.1.2
[voodoo-lang.git] / test / group.voo
blobbd3696db5f2845121e91f2816ef2a880b9dc9607
1 # Test for groups.
3 section data
4 import test_group
6 format_string:
7 string "%s\n\x00"
9 format_word:
10 string "%d\n\x00"
12 new_string:
13 string "ok done\x00"
16 section functions
17 import get_first get_second get_third memcpy printf
18 export main
20 align
21 main:
22 function argc argv
23     let x @test_group
24     call printf format_word x
26     let address add test_group %bytes-per-word
27     call printf format_string address
29     set address add address 8
30     call printf format_word @address
32     set @address 0
33     set address sub address 8
34     call memcpy address new_string 8
35     set @test_group 18
37     set x call get_first
38     call printf format_word x
40     set x call get_second
41     call printf format_string x
43     set x call get_third
44     call printf format_word x
46     return 0
47 end function