#!/bin/sh

source $testsuitedir/lib_test.sh

cat > PROGRAMME << EOP
	:new INT*6, STR
	3 -> &0
	4 -> &1
	"function" -> &6
	:call @&6 &0
	5 -> &3
	2 -> &4
	"other_function" -> &6
	:call @&6 &3
	:shutdown
:label function
	@:current + 1 -> (:current+2)
	@(:current+1) * @(:current+2) -> (:current+2)
	:return
:label other_function
	@:current - 1 -> (:current+2)
	@(:current+1) * @(:current+2) -> (:current+2)
	:return
EOP

cat > MEMOIRE_INITIALE << EOM
# Memory:
# Aliases:
# Free addresses:
# Free blocks:
# End of memory
EOM

cat > MEMOIRE_REF << EOM
# Memory:
#> &0 : INT 3
#> &1 : INT 4
#> &2 : INT 16
#> &3 : INT 5
#> &4 : INT 2
#> &5 : INT 8
#> &6 : STR "other_function"
# Aliases:
# Free addresses:
# Free blocks:
# End of memory
EOM

cat > STDOUT_REF << EOS
EOS

cat > STDERR_REF << EOS
EOS

cat > CODE_RETOUR_REF << EOC
0
EOC

test_basique
