Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix all tests which failed in zeroargs_subs_checking branch

  • Loading branch information...
commit 81b0439853acb4dc1cfabc3cbf404e5ca260d901 1 parent 1c33c8f
@Kristaba Kristaba authored
View
4 t/compilers/imcc/reg/alloc.t
@@ -26,8 +26,8 @@ lab:
ex:
.end
.sub alligator
- get_params "0", $P0
- invokecc $P0
+ .param pmc foo
+ invokecc foo
.end
CODE
Hi
View
5 t/compilers/imcc/syn/pcc.t
@@ -511,8 +511,13 @@ OUT
my $too_many_args = <<'CODE';
.sub main :main
+ push_eh eh
'foo'(_ARGS_)
+ goto no_eh
+eh:
+ pop_eh
say "didn't segfault"
+no_eh:
.end
.sub foo
View
2  t/compilers/imcc/syn/subflags.t
@@ -121,10 +121,12 @@ test flags on PIR subs
.end
.sub 'xyz' :multi(Integer) :subid('above')
+ .param pmc lure
.return('xyz above')
.end
.sub 'xyz' :multi(String) :subid('below')
+ .param pmc lure
.return('xyz below')
.end
View
15 t/compilers/imcc/syn/tail.t
@@ -48,9 +48,8 @@ pir_output_is( <<'CODE', <<'OUT', "tail call optimization, final position" );
.end
.sub _funcall
- .local pmc function
- .local pmc argv
- get_params "0,0x20", function, argv
+ .param pmc function
+ .param pmc argv :slurpy
print "[doing _funcall]\n"
$I33 = defined function
if $I33 goto doit
@@ -64,9 +63,8 @@ doit:
## Return quotient and remainder as two integers.
.sub _floor
- .local pmc arg1
- .local pmc arg2
- get_params "0,0", arg1, arg2
+ .param pmc arg1
+ .param pmc arg2
$P1 = new 'Integer'
$P1 = arg1 / arg2
## truncate.
@@ -80,9 +78,8 @@ doit:
## Return the sum and the two arguments as three integers.
.sub _fib_step
- .local pmc arg1
- .local pmc arg2
- get_params "0,0", arg1, arg2
+ .param pmc arg1
+ .param pmc arg2
$P1 = new 'Integer'
$P1 = arg1 + arg2
set_returns "0,0,0", $P1, arg1, arg2
View
2  t/oo/composition.t
@@ -46,12 +46,14 @@ Tests role composition in the OO implementation.
.return('Snake!')
.end
.sub fire
+ .param pmc self
.return("You're FIRED!")
.end
.sub fire2
.return('BURNINATION!')
.end
.sub give_payrise
+ .param pmc self
.return('You all get a pay rise of 0.0005%.')
.end
View
31 t/oo/objects.t
@@ -263,11 +263,13 @@ Tests the object/class subsystem.
.end
.sub sayFoo31
+ .param pmc self
ok( 1, 'called method added before creating obj' )
.end
.namespace ['Bar31']
.sub sayBar31
+ .param pmc self
ok( 1, 'called method added after created obj' )
.end
@@ -1638,38 +1640,40 @@ end:
# set(obj: Pvalue, Iattr_idx)
.sub Foo54__set
- get_params "0,0", $P5, $S4
+ .param pmc arg1
+ .param string arg2
ok( 1, "in Foo54__set" )
interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
- setattribute $P2, $S4, $P5
+ setattribute $P2, arg2, arg1
set_returns ""
returncc
.end
# Pattr = get(obj: Iattr_idx)
.sub Foo54__get
- get_params "0", $S4
+ .param string arg
ok( 1, "in Foo54__get" )
interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
- getattribute $P5, $P2, $S4
+ getattribute $P5, $P2, arg
set_returns "0", $P5
returncc
.end
.sub Bar54__set
- get_params "0,0", $P5, $S4
+ .param pmc arg1
+ .param string arg2
interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
ok( 1, "in Bar54__set" )
- setattribute $P2, $S4, $P5
+ setattribute $P2, arg2, arg1
set_returns ""
returncc
.end
.sub Bar54__get
- get_params "0", $S4
+ .param string arg
ok( 1, "in Bar54__get" )
interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
- getattribute $P5, $P2, $S4
+ getattribute $P5, $P2, arg
set_returns "0", $P5
returncc
.end
@@ -1757,18 +1761,21 @@ end:
# set(obj: Pvalue, SClass, Sattr)
.sub set
- get_params "0,0,0", $P5, $S4, $S5
+ .param pmc value
+ .param string classname
+ .param string attrname
interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
- setattribute $P2, $S5, $P5
+ setattribute $P2, attrname, value
set_returns ""
returncc
.end
# Pattr = get(obj: SClass, Sattr)
.sub get
- get_params "0,0", $S4, $S5
+ .param string classname
+ .param string attrname
interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
- getattribute $P5, $P2, $S5
+ getattribute $P5, $P2, attrname
set_returns "0", $P5
returncc
.end
View
123 t/op/calling.t
@@ -267,8 +267,8 @@ pir_output_is( <<'CODE', <<'OUTPUT', "use it in PIR" );
invokecc $P1
.end
.sub foo
- get_params "0", $P0
- print $P0
+ .param pmc arg
+ print arg
.end
CODE
hello
@@ -341,8 +341,8 @@ pir_output_is( <<'CODE', <<'OUTPUT', "use it in PIR" );
invokecc $P1
.end
.sub foo
- get_params "0", $P0
- print $P0
+ .param pmc arg
+ print arg
.end
CODE
hello
@@ -358,14 +358,14 @@ pir_output_is( <<'CODE', <<'OUTPUT', "type conversion - autobox" );
invokecc $P1
.end
.sub foo
- get_params "0x20", $P0
- $S0 = $P0[0]
+ .param pmc slurpy_arg :slurpy
+ $S0 = slurpy_arg[0]
print $S0
print ' '
- $S0 = $P0[1]
+ $S0 = slurpy_arg[1]
print $S0
print ' '
- $S0 = $P0[2]
+ $S0 = slurpy_arg[2]
print $S0
print "\n"
.end
@@ -419,14 +419,18 @@ pir_output_is( <<'CODE', <<'OUTPUT', "type conversion - fetch" );
invokecc $P10
.end
.sub foo
- get_params "0,0,0,0", $P0, $I0, $S0, $N0
- print $P0
+ .param pmc arg_pmc
+ .param int arg_int
+ .param string arg_str
+ .param num arg_num
+
+ print arg_pmc
print ' '
- print $I0
+ print arg_int
print ' '
- print $S0
+ print arg_str
print ' '
- print $N0
+ print arg_num
print "\n"
returncc
.end
@@ -445,15 +449,16 @@ pir_error_output_like( <<'CODE', <<'OUTPUT', "argc mismatch, too few" );
invokecc $P1
.end
.sub foo
- get_params "0,0", $P0, $P1
+ .param pmc arg1
+ .param pmc arg2
print $P0
.end
CODE
/too few positional arguments/
OUTPUT
-pir_output_like(
- <<'CODE', <<'OUTPUT', "argc mismatch, too many - no getparams", todo => 'no get_params at all' );
+pir_error_output_like(
+ <<'CODE', <<'OUTPUT', "argc mismatch, too many - no getparams");
.sub main :main
.include "errors.pasm"
errorson .PARROT_ERRORS_PARAM_COUNT_FLAG
@@ -463,7 +468,7 @@ pir_output_like(
print "nada"
.end
CODE
-/too many arguments passed/
+/too many positional arguments/
OUTPUT
pir_error_output_like( <<'CODE', <<'OUTPUT', "argc mismatch, too many - force get_params" );
@@ -507,15 +512,9 @@ pir_output_like( <<'CODE', <<'OUTPUT', "argc mismatch, too many - catch exceptio
errorson .PARROT_ERRORS_PARAM_COUNT_FLAG
$P0 = new 'String'
$P0 = "hello\n"
- find_name $P1, "foo"
- set_args "0,0", $P0, 77
- invokecc $P1
-.end
-.sub foo
push_eh arg_handler
- get_params "0", $P0
- print $P0
- print "never\n"
+ foo($P0, 77)
+ goto no_eh
arg_handler:
get_results "0", $P1
$S0 = $P1
@@ -524,6 +523,13 @@ arg_handler:
# $S1 = typeof $P1
# print "\nexception type: "
# print $S1
+no_eh:
+.end
+.sub foo
+ .param pmc arg
+ print arg
+ print "never\n"
+
.end
CODE
/^caught: too many positional arguments/
@@ -540,9 +546,11 @@ pir_output_is( <<'CODE', <<'OUTPUT', "argc mismatch, optional" );
invokecc $P1
.end
.sub foo
- get_params "0,0x80,0x100", $P0, $P1, $I0
- print $P0
- if_null $P1, ok
+ .param pmc arg1
+ .param pmc arg2 :optional
+ .param int flag_arg2 :opt_flag
+ print arg1
+ if_null arg2, ok
print "not "
ok:
print "ok\n"
@@ -646,9 +654,9 @@ pir_output_is( <<'CODE', <<'OUTPUT', "tailcall 2 - pass arg" );
tailcall b
.end
.sub bar
- get_params "0", $S0
+ .param string arg
print "bar\n"
- print $S0
+ print arg
set_returns "0", "bar_ret\n"
returncc
.end
@@ -675,9 +683,9 @@ pir_output_is( <<'CODE', <<'OUTPUT', "tailcall 3 - pass arg" );
tailcall b
.end
.sub bar
- get_params "0", $S0
+ .param string arg
print "bar\n"
- print $S0
+ print arg
set_returns "0", "bar_ret\n"
returncc
.end
@@ -717,8 +725,9 @@ pir_output_is( <<'CODE', <<'OUTPUT', "optional args" );
invokecc $P1
.end
.sub foo
- get_params "0x80, 0x100", $P1, $I0
- unless_null $P1, ok
+ .param pmc arg :optional
+ .param int flag_arg :opt_flag
+ unless_null arg, ok
print "not "
ok:
print "ok\n"
@@ -735,10 +744,11 @@ pir_output_is( <<'CODE', <<'OUTPUT', "pir uses no ops" );
.end
.sub foo
- get_params "0, 0", $I16, $I17
- print $I16
+ .param int arg1
+ .param int arg2
+ print arg1
print "\n"
- print $I17
+ print arg2
print "\n"
set_returns ""
returncc
@@ -808,30 +818,36 @@ pir_output_is( <<'CODE', <<'OUTPUT', "type conversion - native" );
foo_string(42, "42", 42.20)
.end
.sub foo_int
- get_params "0,0,0", $I0, $I1, $I2
- print $I0
+ .param int arg1
+ .param int arg2
+ .param int arg3
+ print arg1
print ' '
- print $I1
+ print arg2
print ' '
- print $I2
+ print arg3
print "\n"
.end
.sub foo_float
- get_params "0,0,0", $N0, $N1, $N2
- print $N0
+ .param num arg1
+ .param num arg2
+ .param num arg3
+ print arg1
print ' '
- print $N1
+ print arg2
print ' '
- print $N2
+ print arg3
print "\n"
.end
.sub foo_string
- get_params "0,0,0", $S0, $S1, $S2
- print $S0
+ .param string arg1
+ .param string arg2
+ .param string arg3
+ print arg1
print ' '
- print $S1
+ print arg2
print ' '
- print $S2
+ print arg3
print "\n"
.end
CODE
@@ -1353,7 +1369,10 @@ pir_output_is( <<'CODE', <<'OUTPUT', "tailcall - overlapping Ix" );
tailcall b
.end
.sub bar
- get_params "0,0", $I0, $I1
+ .param int arg1
+ .param int arg2
+ $I0 = arg1
+ $I1 = arg2
.return ($I0, $I1)
.end
CODE
@@ -2451,7 +2470,7 @@ CODE
2
OUTPUT
-pir_error_output_like( <<'CODE', <<'OUTPUT', "arg mismatch with no params", todo=> 'TT #1033' );
+pir_error_output_like( <<'CODE', <<'OUTPUT', "arg mismatch with no params");
.sub main :main
foo(1)
.end
@@ -2459,7 +2478,7 @@ pir_error_output_like( <<'CODE', <<'OUTPUT', "arg mismatch with no params", todo
.sub foo
.end
CODE
-/too many arguments passed\(1\) - 0 params expected/
+/too many positional arguments: 1 passed, 0 expected/
OUTPUT
# See Rakudo queue http://rt.perl.org/rt3/Ticket/Display.html?id=62730
View
4 t/pmc/class.t
@@ -398,6 +398,8 @@ t_class_meth:
ok($I0, 'add_vtable_override() with invalid name fails')
.end
.sub 'new_add_role'
+ .param pmc lure1
+ .param pmc lure2
ok(1, 'overridden vtable method called')
.end
@@ -817,10 +819,12 @@ t_class_meth:
.end
.sub 'foo1'
+ .param pmc self
.return(1)
.end
.sub 'foo2'
+ .param pmc self
.return(2)
.end
View
12 t/pmc/multidispatch.t
@@ -1025,11 +1025,14 @@ pir_output_is( <<'CODE', <<'OUTPUT', "multisub w/o .HLL" );
.end
.sub 'foo' :multi(Integer)
+ .param pmc lure
print "foo(Integer)\n"
.return (0)
.end
.sub 'foo' :multi(ResizablePMCArray, _)
+ .param pmc lure1
+ .param pmc lure2
print "foo(ResizablePMCArray,_)\n"
.return (0)
.end
@@ -1053,11 +1056,14 @@ pir_output_is( <<'CODE', <<'OUTPUT', "multisub w/ .HLL, rt #39161" );
.end
.sub 'foo' :multi(Integer)
+ .param pmc lure
print "foo(Integer)\n"
.return (0)
.end
.sub 'foo' :multi(ResizablePMCArray, _)
+ .param pmc lure1
+ .param pmc lure2
print "foo(ResizablePMCArray,_)\n"
.return (0)
.end
@@ -1089,10 +1095,12 @@ pir_output_is( <<'CODE', <<'OUTPUT', "multisub w/ flatten" );
.end
.sub 'foo' :multi(Integer)
+ .param pmc lure
print "foo(Integer)\n"
.end
.sub 'foo' :multi(String)
+ .param pmc lure
print "foo(String)\n"
.end
CODE
@@ -1133,10 +1141,12 @@ pir_output_is( <<'CODE', <<'OUTPUT', "keyed class name and multi" );
.end
.sub 'foo' :multi( [ 'Some'; 'Class' ])
+ .param pmc lure
print "Called multi for class\n"
.end
.sub 'foo' :multi(_)
+ .param pmc lure
print "Called wrong multi\n"
.end
CODE
@@ -1328,9 +1338,11 @@ pir_output_is( <<'CODE', <<'OUTPUT', "multi-dispatch on PMCNULL" );
foo($P0)
.end
.sub foo :multi(String)
+ .param pmc lure
say "string"
.end
.sub foo :multi(_)
+ .param pmc lure
say "any"
.end
CODE
View
3  t/pmc/namespace-subs.t
@@ -148,12 +148,15 @@ specified behavior for :method, :vtable, :nsentry, and :anon.
.namespace ['MultiSubTest']
.sub 'multisubtest' :multi(int)
+ .param pmc lure
.return("called int variant")
.end
.sub 'multisubtest' :multi(string)
+ .param pmc lure
.return("called string variant")
.end
.sub 'multisubtest' :anon :multi(num)
+ .param pmc lure
.return("called num variant")
.end
View
11 t/pmc/nci.t
@@ -1666,21 +1666,22 @@ ERROR:
.end
.sub _call_back
- get_params "0,0", $P5, $P6
+ .param pmc arg1
+ .param pmc arg2
print "in callback\n"
print "user data: "
- print $P5
+ print arg1
print "\n"
- # P6 is a UnManagedStruct PMC containing a pointer to an integer
+ # arg2 is a UnManagedStruct PMC containing a pointer to an integer
new $P2, ['ResizablePMCArray']
push $P2, .DATATYPE_INT
push $P2, 0
push $P2, 0
- assign $P6, $P2
+ assign arg2, $P2
# print referenced integer in libnci_test.so
- $I17 = $P6[0]
+ $I17 = arg2[0]
print "external data: "
print $I17
print "\n"
View
2  t/pmc/object-meths.t
@@ -747,6 +747,7 @@ pir_output_is( <<'CODE', <<'OUTPUT', "method cache invalidation" );
print o
.end
.sub ok2
+ .param pmc self
.return("ok 2\n")
.end
.namespace [ "Foo" ]
@@ -1070,6 +1071,7 @@ pir_output_is( <<'CODE', <<'OUTPUT', "overloading find_method vtable" );
.end
.sub foo
+ .param pmc lure
print "foo was called\n"
.end

0 comments on commit 81b0439

Please sign in to comment.
Something went wrong with that request. Please try again.