repo.or.cz
/
voodoo-lang.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Added test case for auto-words and made it pass on amd64 and i386.
[voodoo-lang.git]
/
test
/
set-word.voo
blob
b111c875f26cbf9ab9bde9cf748a29a2beaadd66
1
#### Test program for set-word
2
3
section data
4
format:
5
string "%d\x0a\x00"
6
7
data:
8
word 0
9
word 1
10
11
section functions
12
import printf
13
export main
14
15
main:
16
function argc argv
17
let x get-word data 0
18
call printf format x
19
set x get-word data 1
20
call printf format x
21
22
set-word data 0 12
23
set x 42
24
set-word data 1 x
25
26
set x get-word data 0
27
call printf format x
28
set x get-word data 1
29
call printf format x
30
31
let i 0
32
set-word data i 42
33
set x 43
34
set i add i 1
35
set-word data i x
36
37
set x get-word data i
38
call printf format x
39
set i sub i 1
40
set x get-word data i
41
call printf format x
42
43
return 0
44
end function