Encode.xs: add an explicit cast to make g++ happier
[p5sagit/p5-mst-13.2.git] / ext / B / t / optree_varinit.t
index 04c2b80..e25447d 100644 (file)
@@ -23,9 +23,18 @@ skip "no perlio in this build", 22 unless $Config::Config{useperlio};
 
 pass("OPTIMIZER TESTS - VAR INITIALIZATION");
 
+my @open_todo;
+sub open_todo {
+    if (((caller 0)[10]||{})->{open}) {
+       @open_todo = (skip => "\$^OPEN is set");
+    }
+}
+open_todo;
+
 checkOptree ( name     => 'sub {my $a}',
              bcopts    => '-exec',
              code      => sub {my $a},
+             @open_todo,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 # 1  <;> nextstate(main 45 optree.t:23) v
 # 2  <0> padsv[$a:45,46] M/LVINTRO
@@ -39,6 +48,7 @@ EONT_EONT
 checkOptree ( name     => '-exec sub {my $a}',
              bcopts    => '-exec',
              code      => sub {my $a},
+             @open_todo,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 # 1  <;> nextstate(main 49 optree.t:52) v
 # 2  <0> padsv[$a:49,50] M/LVINTRO
@@ -52,6 +62,7 @@ EONT_EONT
 checkOptree ( name     => 'sub {our $a}',
              bcopts    => '-exec',
              code      => sub {our $a},
+             @open_todo,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 1  <;> nextstate(main 21 optree.t:47) v
 2  <#> gvsv[*a] s/OURINTR
@@ -65,6 +76,7 @@ EONT_EONT
 checkOptree ( name     => 'sub {local $a}',
              bcopts    => '-exec',
              code      => sub {local $a},
+             @open_todo,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 1  <;> nextstate(main 23 optree.t:57) v:{
 2  <#> gvsv[*a] s/LVINTRO
@@ -78,6 +90,7 @@ EONT_EONT
 checkOptree ( name     => 'my $a',
              prog      => 'my $a',
              bcopts    => '-basic',
+             @open_todo,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 # 4  <@> leave[1 ref] vKP/REFC ->(end)
 # 1     <0> enter ->2
@@ -93,6 +106,7 @@ EONT_EONT
 checkOptree ( name     => 'our $a',
              prog      => 'our $a',
              bcopts    => '-basic',
+             @open_todo,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 4  <@> leave[1 ref] vKP/REFC ->(end)
 1     <0> enter ->2
@@ -111,6 +125,7 @@ checkOptree ( name  => 'local $a',
              prog      => 'local $a',
              errs      => ['Name "main::a" used only once: possible typo at -e line 1.'],
              bcopts    => '-basic',
+             @open_todo,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 4  <@> leave[1 ref] vKP/REFC ->(end)
 1     <0> enter ->2
@@ -130,6 +145,7 @@ pass("MY, OUR, LOCAL, BOTH SUB AND MAIN, = undef");
 checkOptree ( name     => 'sub {my $a=undef}',
              code      => sub {my $a=undef},
              bcopts    => '-basic',
+             @open_todo,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 5  <1> leavesub[1 ref] K/REFC,1 ->(end)
 -     <@> lineseq KP ->5
@@ -150,6 +166,7 @@ checkOptree ( name  => 'sub {our $a=undef}',
              code      => sub {our $a=undef},
              note      => 'the global must be reset',
              bcopts    => '-basic',
+             @open_todo,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 5  <1> leavesub[1 ref] K/REFC,1 ->(end)
 -     <@> lineseq KP ->5
@@ -172,6 +189,7 @@ checkOptree ( name  => 'sub {local $a=undef}',
              code      => sub {local $a=undef},
              note      => 'local not used enough to bother',
              bcopts    => '-basic',
+             @open_todo,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 5  <1> leavesub[1 ref] K/REFC,1 ->(end)
 -     <@> lineseq KP ->5
@@ -193,6 +211,7 @@ EONT_EONT
 checkOptree ( name     => 'my $a=undef',
              prog      => 'my $a=undef',
              bcopts    => '-basic',
+             @open_todo,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 6  <@> leave[1 ref] vKP/REFC ->(end)
 1     <0> enter ->2
@@ -213,6 +232,7 @@ checkOptree ( name  => 'our $a=undef',
              prog      => 'our $a=undef',
              note      => 'global must be reassigned',
              bcopts    => '-basic',
+             @open_todo,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 6  <@> leave[1 ref] vKP/REFC ->(end)
 1     <0> enter ->2
@@ -236,6 +256,7 @@ checkOptree ( name  => 'local $a=undef',
              errs      => ['Name "main::a" used only once: possible typo at -e line 1.'],
              note      => 'locals are rare, probly not worth doing',
              bcopts    => '-basic',
+             @open_todo,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 6  <@> leave[1 ref] vKP/REFC ->(end)
 1     <0> enter ->2
@@ -257,6 +278,7 @@ EONT_EONT
 checkOptree ( name     => 'sub {my $a=()}',
              code      => sub {my $a=()},
              bcopts    => '-exec',
+             @open_todo,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 1  <;> nextstate(main -439 optree.t:105) v
 2  <0> stub sP
@@ -275,6 +297,7 @@ checkOptree ( name  => 'sub {our $a=()}',
              code      => sub {our $a=()},
               #todo    => 'probly not worth doing',
              bcopts    => '-exec',
+             @open_todo,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 1  <;> nextstate(main 31 optree.t:177) v:{
 2  <0> stub sP
@@ -293,6 +316,7 @@ checkOptree ( name  => 'sub {local $a=()}',
              code      => sub {local $a=()},
               #todo    => 'probly not worth doing',
              bcopts    => '-exec',
+             @open_todo,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 1  <;> nextstate(main 33 optree.t:190) v:{
 2  <0> stub sP
@@ -310,6 +334,7 @@ EONT_EONT
 checkOptree ( name     => 'my $a=()',
              prog      => 'my $a=()',
              bcopts    => '-exec',
+             @open_todo,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 1  <0> enter 
 2  <;> nextstate(main 1 -e:1) v:{
@@ -330,6 +355,7 @@ checkOptree ( name  => 'our $a=()',
              prog      => 'our $a=()',
               #todo    => 'probly not worth doing',
              bcopts    => '-exec',
+             @open_todo,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 1  <0> enter 
 2  <;> nextstate(main 1 -e:1) v:{
@@ -351,6 +377,7 @@ checkOptree ( name  => 'local $a=()',
              errs      => ['Name "main::a" used only once: possible typo at -e line 1.'],
               #todo    => 'probly not worth doing',
              bcopts    => '-exec',
+             @open_todo,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 1  <0> enter 
 2  <;> nextstate(main 1 -e:1) v:{
@@ -371,6 +398,7 @@ checkOptree ( name  => 'my ($a,$b)=()',
              prog      => 'my ($a,$b)=()',
               #todo    => 'probly not worth doing',
              bcopts    => '-exec',
+             @open_todo,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 # 1  <0> enter 
 # 2  <;> nextstate(main 1 -e:1) v:{