X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/fc23c914f8de7cb85f58830142e0164864d4601c..17a8df707746ce70979d18c5b5f9e383c365bbff:/t/perf/opcount.t diff --git a/t/perf/opcount.t b/t/perf/opcount.t index 372c47f..3351f50 100644 --- a/t/perf/opcount.t +++ b/t/perf/opcount.t @@ -766,4 +766,19 @@ test_opcount(0, "builtin::reftype is replaced with direct opcode", reftype => 1, }); +my $one_point_five = 1.5; # Prevent const-folding. +test_opcount(0, "builtin::ceil is replaced with direct opcode", + sub { builtin::ceil($one_point_five); }, + { + entersub => 0, + ceil => 1, + }); + +test_opcount(0, "builtin::floor is replaced with direct opcode", + sub { builtin::floor($one_point_five); }, + { + entersub => 0, + floor => 1, + }); + done_testing();