2 # Copyright (C) 2001-2006, The Perl Foundation.
7 use lib qw( . lib ../lib ../../lib );
10 use Parrot::Test tests => 9;
14 t/op/interp.t - Running the Interpreter
22 Tests the old and new styles of running the Parrot interpreter and the
28 skip( "we really shouldn't run just a label - use a sub", 1 );
30 pasm_output_is( <<'CODE', <<'OUTPUT', "runinterp - new style" );
31 new P0, 'ParrotInterpreter'
48 pir_output_is( <<'CODE', <<'OUTPUT', 'runinterp - works without printing' );
51 .local pmc test_interp
52 test_interp = new 'ParrotInterpreter'
58 runinterp test_interp, pasm
64 if $S0 goto get_stdout
81 <<'CODE', <<'OUTPUT', 'runinterp - works with printing', todo => 'something funky here' );
84 .local pmc test_interp
85 test_interp = new 'ParrotInterpreter'
91 runinterp test_interp, pasm
97 if $S0 goto get_stdout
104 print "y uno es igual a\n"
114 # Need to disable DOD while trace is on, as there's a non-zero chance that a
115 # DOD sweep would occur, causing a bonus "DOD" line in the output, which makes
118 <<'CODE', <<'OUTPUT', "restart trace", todo => "lines are out of order due to buffering" );
138 # This is the behavior as of Parrot 0.4.3
139 # RT#46819 Should there be a warning?
140 pasm_output_is( <<'CODE', 'nada:', 'interp - warnings' );
150 pasm_output_is( <<'CODE', <<'OUTPUT', "getinterp" );
151 .include "interpinfo.pasm"
154 set I0, P0[.INTERPINFO_ACTIVE_PMCS]
155 interpinfo I1, .INTERPINFO_ACTIVE_PMCS
166 pasm_output_is( <<'CODE', <<'OUTPUT', "access argv" );
168 .include "iglobals.pasm"
170 set P2, P1[.IGLOBALS_ARGV_LIST]
189 pasm_output_is( <<'CODE', <<'OUTPUT', "check_events" );
200 pir_output_is( <<'CODE', <<'OUTPUT', "interpinfo & getinterp: current runcore" );
201 .include 'interpinfo.pasm'
202 .include 'interpcores.pasm'
205 $I0 = interpinfo .INTERPINFO_CURRENT_RUNCORE
206 if $I0 == .PARROT_FUNCTION_CORE goto ok1
207 if $I0 == .PARROT_FAST_CORE goto ok1
208 if $I0 == .PARROT_SWITCH_CORE goto ok1
209 if $I0 == .PARROT_CGOTO_CORE goto ok1
210 if $I0 == .PARROT_CGP_CORE goto ok1
211 if $I0 == .PARROT_JIT_CORE goto ok1
212 if $I0 == .PARROT_SWITCH_JIT_CORE goto ok1
213 if $I0 == .PARROT_CGP_JIT_CORE goto ok1
214 if $I0 == .PARROT_EXEC_CORE goto ok1
215 if $I0 == .PARROT_GC_DEBUG_CORE goto ok1
221 $I1 = $P0[.INTERPINFO_CURRENT_RUNCORE]
222 if $I0 == $I1 goto ok2
235 # cperl-indent-level: 4
238 # vim: expandtab shiftwidth=4: