Update tests for __emit

This commit is contained in:
Daniel_Cortez 2019-07-05 19:10:25 +07:00
parent b7fd80382a
commit 448aa3b051
5 changed files with 33 additions and 24 deletions

View File

@ -3,5 +3,6 @@
const global_const = 0;
new stock global_var = 0;
new stock global_array[2];
new stock const global_const_var = 0;
forward global_func(); public global_func() { return 0; }
native global_native(const string[]) = print;

View File

@ -9,17 +9,18 @@ __emit_p6.pwn(45) : error 022: must be lvalue (non-constant)
__emit_p6.pwn(46) : error 022: must be lvalue (non-constant)
__emit_p6.pwn(47) : error 022: must be lvalue (non-constant)
__emit_p6.pwn(48) : error 022: must be lvalue (non-constant)
__emit_p6.pwn(49) : error 033: array must be indexed (variable "local_array")
__emit_p6.pwn(50) : error 033: array must be indexed (variable "local_refarray")
__emit_p6.pwn(69) : error 022: must be lvalue (non-constant)
__emit_p6.pwn(70) : error 022: must be lvalue (non-constant)
__emit_p6.pwn(49) : error 022: must be lvalue (non-constant)
__emit_p6.pwn(50) : error 033: array must be indexed (variable "local_array")
__emit_p6.pwn(51) : error 033: array must be indexed (variable "local_refarray")
__emit_p6.pwn(71) : error 022: must be lvalue (non-constant)
__emit_p6.pwn(72) : error 022: must be lvalue (non-constant)
__emit_p6.pwn(73) : error 033: array must be indexed (variable "local_array")
__emit_p6.pwn(74) : error 033: array must be indexed (variable "local_refarray")
__emit_p6.pwn(96) : error 076: syntax error in the expression, or invalid function call
__emit_p6.pwn(97) : error 076: syntax error in the expression, or invalid function call
__emit_p6.pwn(98) : error 033: array must be indexed (variable "local_array")
__emit_p6.pwn(99) : error 033: array must be indexed (variable "local_refarray")
__emit_p6.pwn(73) : error 022: must be lvalue (non-constant)
__emit_p6.pwn(74) : error 022: must be lvalue (non-constant)
__emit_p6.pwn(75) : error 033: array must be indexed (variable "local_array")
__emit_p6.pwn(76) : error 033: array must be indexed (variable "local_refarray")
__emit_p6.pwn(98) : error 076: syntax error in the expression, or invalid function call
__emit_p6.pwn(99) : error 076: syntax error in the expression, or invalid function call
__emit_p6.pwn(100) : error 033: array must be indexed (variable "local_array")
__emit_p6.pwn(101) : error 033: array must be indexed (variable "local_refarray")
"""
}

View File

@ -45,6 +45,7 @@ stock test__op_stor_u_pri_alt(&local_refvar, local_refarray[])
emit stor.u.pri global_const;
emit stor.u.pri global_func;
emit stor.u.pri global_native;
emit stor.u.pri global_const_var;
emit stor.u.pri local_const;
emit stor.u.pri local_array;
emit stor.u.pri local_refarray;
@ -59,6 +60,7 @@ stock test__op_addr_u_pri_alt(&local_refvar, local_refarray[])
// ok
emit addr.u.pri global_var;
emit addr.u.pri global_const_var;
emit addr.u.pri local_var;
emit addr.u.pri local_static_var;
emit addr.u.pri local_refvar;
@ -104,7 +106,7 @@ main()
{
new t, a[2];
test__op_load_u_pri_alt(t, a); // 4
test__op_stor_u_pri_alt(t, a); // 6
test__op_stor_u_pri_alt(t, a); // 7
test__op_addr_u_pri_alt(t, a); // 6
test__push_u(t, a); // 4
}

View File

@ -1,25 +1,27 @@
{
'test_type': 'output_check',
'errors': """
__emit_p7.pwn(20) : error 022: must be lvalue (non-constant)
__emit_p7.pwn(21) : error 022: must be lvalue (non-constant)
__emit_p7.pwn(22) : error 022: must be lvalue (non-constant)
__emit_p7.pwn(23) : error 022: must be lvalue (non-constant)
__emit_p7.pwn(24) : error 033: array must be indexed (variable "local_array")
__emit_p7.pwn(25) : error 033: array must be indexed (variable "local_refarray")
__emit_p7.pwn(26) : error 035: argument type mismatch (argument 1)
__emit_p7.pwn(24) : error 022: must be lvalue (non-constant)
__emit_p7.pwn(25) : error 033: array must be indexed (variable "local_array")
__emit_p7.pwn(26) : error 033: array must be indexed (variable "local_refarray")
__emit_p7.pwn(27) : error 035: argument type mismatch (argument 1)
__emit_p7.pwn(46) : error 022: must be lvalue (non-constant)
__emit_p7.pwn(28) : error 035: argument type mismatch (argument 1)
__emit_p7.pwn(47) : error 022: must be lvalue (non-constant)
__emit_p7.pwn(48) : error 022: must be lvalue (non-constant)
__emit_p7.pwn(49) : error 022: must be lvalue (non-constant)
__emit_p7.pwn(50) : error 033: array must be indexed (variable "local_array")
__emit_p7.pwn(51) : error 033: array must be indexed (variable "local_refarray")
__emit_p7.pwn(70) : error 022: must be lvalue (non-constant)
__emit_p7.pwn(71) : error 022: must be lvalue (non-constant)
__emit_p7.pwn(50) : error 022: must be lvalue (non-constant)
__emit_p7.pwn(51) : error 022: must be lvalue (non-constant)
__emit_p7.pwn(52) : error 033: array must be indexed (variable "local_array")
__emit_p7.pwn(53) : error 033: array must be indexed (variable "local_refarray")
__emit_p7.pwn(72) : error 022: must be lvalue (non-constant)
__emit_p7.pwn(73) : error 022: must be lvalue (non-constant)
__emit_p7.pwn(74) : error 033: array must be indexed (variable "local_array")
__emit_p7.pwn(75) : error 033: array must be indexed (variable "local_refarray")
__emit_p7.pwn(74) : error 022: must be lvalue (non-constant)
__emit_p7.pwn(75) : error 022: must be lvalue (non-constant)
__emit_p7.pwn(76) : error 022: must be lvalue (non-constant)
__emit_p7.pwn(77) : error 033: array must be indexed (variable "local_array")
__emit_p7.pwn(78) : error 033: array must be indexed (variable "local_refarray")
"""
}

View File

@ -10,6 +10,7 @@ stock test__push_u_adr(&local_refvar, local_refarray[])
// ok
emit push.u.adr global_var;
emit push.u.adr global_const_var;
emit push.u.adr local_refvar;
emit push.u.adr local_var;
emit push.u.adr local_static_var;
@ -46,6 +47,7 @@ stock test__zero_u(&local_refvar, local_refarray[])
emit zero.u global_const;
emit zero.u global_func;
emit zero.u global_native;
emit zero.u global_const_var;
emit zero.u local_const;
emit zero.u local_array;
emit zero.u local_refarray;
@ -70,6 +72,7 @@ stock test__inc_dec_u(&local_refvar, local_refarray[])
emit inc.u global_const;
emit inc.u global_func;
emit inc.u global_native;
emit inc.u global_const_var;
emit inc.u local_const;
emit inc.u local_array;
emit inc.u local_refarray;
@ -80,6 +83,6 @@ main()
{
new t, a[2];
test__push_u_adr(t, a); // 8
test__zero_u(t, a); // 6
test__inc_dec_u(t, a); // 6
test__zero_u(t, a); // 7
test__inc_dec_u(t, a); // 7
}