Index: t/op/stacks.t =================================================================== --- t/op/stacks.t (revision 10945) +++ t/op/stacks.t (working copy) @@ -605,9 +605,49 @@ Stack 'Control' too deep OUTPUT } + +{ +local $TODO = 'bug: stack state is saved across call/return'; + +pir_output_is(<<'CODE', <<'OUTPUT', "save/restore across contexts [1]"); +.sub main :main + $I0 = 11 + save $I0 + test_1() + restore $I0 + print $I0 + print "\n" +.end +.sub test_1 + save 22 +.end +CODE +22 +OUTPUT + +pir_output_is(<<'CODE', <<'OUTPUT', "save/restore across contexts [2]"); +.sub main :main + $I0 = 11 + save $I0 + inc $I0 + save $I0 + test_1() + restore $I0 + print $I0 + print "\n" +.end +.sub test_1 + restore $I22 +.end +CODE +11 +OUTPUT + +} + ############################## ## remember to change the number of tests :-) -BEGIN { plan tests => 24; } +BEGIN { plan tests => 26; }