2 # Copyright (C) 2001-2006, The Perl Foundation.
8 use lib qw( . lib ../lib ../../lib );
11 use Parrot::Test tests => 7;
15 t/op/pushaction.t - Test the C<pushaction> Instruction
19 % prove t/pmc/pushaction.t
23 Tests the C<pushaction> instruction. Note that there are also uses of
24 C<pushaction> in C<t/pmc/exception.t> and C<t/pmc/continuation.t>. If
25 you want to add a test that requires a continuation or throws an
26 error, you probably want to put it in one of those files instead.
30 pasm_output_is( <<'CODE', <<'OUTPUT', "pushaction" );
33 .const .Sub P10 = "action"
41 print "in action I5 = "
52 pir_output_is( <<'CODE', <<'OUTPUT', "pushaction, sub exit" );
60 .const .Sub ac = "action"
67 print "in action I5 = "
78 pir_output_is( <<'CODE', <<'OUTPUT', "pushaction, sub exit - capture CC" );
86 .const .Sub ac = "action"
88 .include "interpinfo.pasm"
90 cc = interpinfo .INTERPINFO_CURRENT_CONT
104 pir_output_is( <<'CODE', <<'OUTPUT', "pushaction, sub exit - capture CC, ret" );
112 .const .Sub ac = "action"
114 .include "interpinfo.pasm"
116 cc = interpinfo .INTERPINFO_CURRENT_CONT
131 pir_output_is( <<'CODE', <<'OUTPUT', "pushaction - return from main" );
134 .const .Sub at_exit = "exit_handler"
141 print "at_exit, flag = "
149 pir_output_is( <<'CODE', <<'OUTPUT', "pushaction - end in main" );
152 .const .Sub at_exit = "exit_handler"
154 # IMCC inserts end here, because it is :main
159 print "at_exit, flag = "
166 pir_output_is( <<'CODE', <<'OUTPUT', "pushaction as closure" );
173 .const .Sub at_exit = "exit_handler"
178 .sub exit_handler :outer(main)
180 print "at_exit, flag = "
195 # cperl-indent-level: 4
198 # vim: expandtab shiftwidth=4: