#!/bin/sh

source $testsuitedir/lib_test.sh

cat > PROGRAMME << EOP
	:new INT, STR/label
	"invalide" -> label
	:goto @label
	:new STR
:label label
	:new BLN
:label autrelabel
	:new PTR
EOP

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

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

cat > STDOUT_REF << EOS
EOS

cat > STDERR_REF << EOS
+----------------------------------------------------------------------------------------------+
| File PROGRAMME.setlggasm, line 3 > Runtime error (ILL): Inexistant label invalide to jump to |
+----------------------------------------------------------------------------------------------+
EOS

cat > CODE_RETOUR_REF << EOC
129
EOC

test_basique

cat > PROGRAMME << EOP
	:new INT, INT/label
	4 -> label
	:goto @label
	:new STR
:label label
	:new BLN
:label autrelabel
	:new PTR
EOP

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

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

cat > STDOUT_REF << EOS
EOS

cat > STDERR_REF << EOS
+---------------------------------------------------------------------------------------------------------------------------+
| File PROGRAMME.setlggasm, line 3 > Runtime error (SEGV): Read to address &1 incorrect as value type is INT instead of STR |
+---------------------------------------------------------------------------------------------------------------------------+
EOS

cat > CODE_RETOUR_REF << EOC
129
EOC

test_basique
