issue245.t 708 B

1234567891011121314151617181920212223242526
  1. #! /usr/bin/env perl
  2. # http://code.google.com/p/perl-compiler/issues/detail?id=245
  3. # unicode value not preserved when passed to a function with -O3
  4. # lc("\x{1E9E}") and "\x{df}" were hashed as the same string in const %strtable
  5. use strict;
  6. BEGIN {
  7. unshift @INC, 't';
  8. require "test.pl";
  9. }
  10. use Test::More tests => 1;
  11. use B::C;
  12. # passes threaded and <5.10
  13. my $fixed_with = "1.42_70";
  14. my $TODO = "TODO " if $B::C::VERSION lt $fixed_with;
  15. $TODO = "" if $Config{useithreads};
  16. $TODO = "" if $] < 5.010;
  17. my $todomsg = '#245 2nd static unicode char';
  18. ctest(1,"b: 223", 'C,-O3','ccode245i', <<'EOF', $TODO.$todomsg);
  19. sub foo {
  20. my ( $a, $b ) = @_;
  21. print "b: ".ord($b);
  22. }
  23. foo(lc("\x{1E9E}"), "\x{df}");
  24. EOF