issue235.t 871 B

123456789101112131415161718192021222324
  1. #! /usr/bin/env perl
  2. # http://code.google.com/p/perl-compiler/issues/detail?id=235
  3. # branch empty-cv: assert !CvCVGV_RC(cv) in function Perl_newATTRSUB. again.
  4. # skip saving empty CVs
  5. # But note #246 edge-case conflict: skipping empty CVs needs still prototypes
  6. # to be stored if existing, to be able to catch prototype errors.
  7. use strict;
  8. BEGIN {
  9. unshift @INC, 't';
  10. require "test.pl";
  11. }
  12. use Test::More tests => 2;
  13. use B::C;
  14. my $when = "1.42_61";
  15. ctest(1,'6','C,-O3,-UCarp','ccode235i',<<'EOF',($B::C::VERSION lt $when ? "TODO #235 assert !CvCVGV_RC(cv)" : "#235 bytes::length"));
  16. BEGIN{$INC{Carp.pm}++}
  17. my ($d,$ol); $d = pack("U*", 0xe3, 0x81, 0xAF); { use bytes; $ol = bytes::length($d) } print $ol
  18. EOF
  19. ctest(2,'^Not enough arguments for main','C,-O3','ccode235i',<<'EOF',"#246 missing proto decl for empty subs");
  20. sub foo($\@); eval q/foo "s"/; print $@
  21. EOF