issue32.t 599 B

1234567891011121314151617181920212223
  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. BEGIN {
  6. if ($] < 5.008) {
  7. print "1..1\nok 1 #skip 5.6 has no IO discipline\n"; exit;
  8. }
  9. }
  10. use Test::More tests => 1;
  11. BEGIN {
  12. unshift @INC, 't';
  13. require "test.pl";
  14. }
  15. my $name = 'ccode32i.pl';
  16. open my $fh, '>', $name or die;
  17. print $fh 'use open ":encoding(utf8)";my $x;print @ARGV';
  18. close $fh;
  19. my $X = $^X =~ m/\s/ ? qq{"$^X" -Iblib/arch -Iblib/lib} : "$^X -Iblib/arch -Iblib/lib";
  20. is(`$X blib/script/perlcc -O3 -occode32i -r $name 1 2 3`,
  21. '123', "use open and \@ARGV");