2 # Copyright (C) 2009-2010, Parrot Foundation.
7 t/op/cc_params.t - Parrot Calling Conventions parameter matching tests
11 % prove t/op/cc_params.t
15 Tests Parrot calling conventions for parameter matching and mismatching.
20 .include 'test_more.pir'
22 'call_sig_with_no_args'()
23 'call_sig_with_positionals'(1, 2, 3)
24 'call_sig_with_named'(4 :named("x"), 5 :named("y"))
26 $P0 = newclass ['OMGClass']
29 $P1.'wtfmethod'(1, 2, 3 :named("beer"), 4 :named("borovicka"))
32 .sub call_sig_with_no_args
33 .param pmc sig :call_sig
35 is('CallContext', $S0)
40 .sub call_sig_with_positionals
41 .param pmc sig :call_sig
43 is('CallContext', $S0)
54 .sub call_sig_with_named
55 .param pmc sig :call_sig
57 is('CallContext', $S0)
67 .namespace ['OMGClass']
68 .sub 'lolmethod' :method
69 .param pmc sig :call_sig
71 # Self is set up correctly.
77 is('CallContext', $S0)
79 # First element is self.
82 eq_addr $P0, self, sig_ok
89 .sub 'wtfmethod' :method
90 .param pmc sig :call_sig
92 # Self is set up correctly.
98 is('CallContext', $S0)
100 # First element is self.
103 eq_addr $P0, self, sig_ok
117 $I0 = sig['borovicka']
125 # vim: expandtab shiftwidth=4 ft=pir: