issue32.t 564 B

123456789101112131415161718192021
  1. #! /usr/bin/env perl
  2. # http://code.google.com/p/perl-compiler/issues/detail?id=32
  3. # use open and @ARGV
  4. use strict;
  5. use Test::More;
  6. plan skip_all => "$] has no IO discipline" if $] < 5.006;
  7. plan tests => 1;
  8. BEGIN {
  9. unshift @INC, 't';
  10. require TestBC;
  11. }
  12. my $name = 'ccode32i.pl';
  13. open my $fh, '>', $name or die;
  14. print $fh 'use open ":encoding(utf8)";my $x;print @ARGV';
  15. close $fh;
  16. my $X = $^X =~ m/\s/ ? qq{"$^X" -Iblib/arch -Iblib/lib} : "$^X -Iblib/arch -Iblib/lib";
  17. is(`$X blib/script/perlcc -O3 -occode32i -r $name 1 2 3`,
  18. '123', "use open and \@ARGV");