This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
add testing framework for boolean context
Some ops (currently just padhv and rv2hv) are optimised when found to be
in boolean context - by setting a private flag on the op indicating
definite or maybe boolean context. At run time, the op can just return
true / false rather than a real value, which may be cheaper.
This commit adds a bunch of tests in nested loops to optree.t to check
that the right private flags are set for the various permutations of
if (%h || $x) { ...}
etc.
It's written in such a way that its easy to add new ops to it.
At the moment many permutations are actually commented out, as these
(fairly comprehensive) tests show up a number of deficiencies in the
current implementation. These should be fixed in the next commit.