issue48.t 546 B

123456789101112131415161718192021
  1. #! /usr/bin/env perl
  2. # http://code.google.com/p/perl-compiler/issues/detail?id=48
  3. # B:CC takes wrong truth value for array assignment in boolean context
  4. use Test::More tests => 1;
  5. use strict;
  6. BEGIN {
  7. unshift @INC, 't';
  8. require "test.pl";
  9. }
  10. my $script = <<'EOF';
  11. sub f { () }
  12. print((my ($v) = f()) ? 1 : 2, "\n");
  13. EOF
  14. use B::CC;
  15. ctest(1, '^2', "CC", "ccode48i", $script, # fixed with B::CC 1.08 r614
  16. ($B::CC::VERSION < 1.08 ? "TODO " : "")
  17. . "CC wrong truth value for array assignment in boolean context, fixed with B-C-1.28");