summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2001-08-29 19:21:56 +0100
committerAbhijit Menon-Sen <ams@wiw.org>2001-08-29 17:35:33 +0000
commit59d8ce6297a94889161c3324ccfdc9bb1a2d9d05 (patch)
treeb94758262b06c0e83fdd3159f28d814ce474b157 /ext
parentd09712d887062ccb5a1104006dc798bcb5502153 (diff)
downloadperl-59d8ce6297a94889161c3324ccfdc9bb1a2d9d05.tar.gz
pass all tests when compiling with -DNO_PERL_PRESERVE_IVUV
Message-Id: <20010829182156.O4950@plum.flirble.org> p4raw-id: //depot/perl@11788
Diffstat (limited to 'ext')
-rw-r--r--ext/Devel/Peek/Peek.t42
1 files changed, 28 insertions, 14 deletions
diff --git a/ext/Devel/Peek/Peek.t b/ext/Devel/Peek/Peek.t
index c14dc9bdad..be7bf820d7 100644
--- a/ext/Devel/Peek/Peek.t
+++ b/ext/Devel/Peek/Peek.t
@@ -33,6 +33,7 @@ sub do_test {
print "[$dump] vs [$pattern]\nnot " unless $dump =~ /$pattern/ms;
print "ok $_[0]\n";
close(IN);
+ return $1;
} else {
die "$0: failed to open peek$$: !\n";
}
@@ -86,12 +87,17 @@ do_test( 5,
FLAGS = \\(PADBUSY,PADMY,IOK,pIOK\\)
IV = 456');
-do_test( 6,
+# If perl is built with PERL_PRESERVE_IVUV then maths is done as integers
+# where possible and this scalar will be an IV. If NO_PERL_PRESERVE_IVUV then
+# maths is done in floating point always, and this scalar will be an NV.
+# ([NI]) captures the type, referred to by \1 in this regexp and $type for
+# building subsequent regexps.
+my $type = do_test( 6,
$c + $d,
-'SV = IV\\($ADDR\\) at $ADDR
+'SV = ([NI])V\\($ADDR\\) at $ADDR
REFCNT = 1
- FLAGS = \\(PADTMP,IOK,pIOK\\)
- IV = 456');
+ FLAGS = \\(PADTMP,\1OK,p\1OK\\)
+ \1V = 456');
($d = "789") += 0.1;
@@ -132,6 +138,22 @@ do_test(10,
CUR = 3
LEN = 4');
+my $c_pattern;
+if ($type eq 'N') {
+ $c_pattern = '
+ SV = PVNV\\($ADDR\\) at $ADDR
+ REFCNT = 1
+ FLAGS = \\(IOK,NOK,pIOK,pNOK\\)
+ IV = 456
+ NV = 456
+ PV = 0';
+} else {
+ $c_pattern = '
+ SV = IV\\($ADDR\\) at $ADDR
+ REFCNT = 1
+ FLAGS = \\(IOK,pIOK\\)
+ IV = 456';
+}
do_test(11,
[$b,$c],
'SV = RV\\($ADDR\\) at $ADDR
@@ -153,11 +175,7 @@ do_test(11,
REFCNT = 1
FLAGS = \\(IOK,pIOK\\)
IV = 123
- Elt No. 1
- SV = IV\\($ADDR\\) at $ADDR
- REFCNT = 1
- FLAGS = \\(IOK,pIOK\\)
- IV = 456');
+ Elt No. 1' . $c_pattern);
do_test(12,
{$b=>$c},
@@ -177,11 +195,7 @@ do_test(12,
MAX = 7
RITER = -1
EITER = 0x0
- Elt "123" HASH = $ADDR
- SV = IV\\($ADDR\\) at $ADDR
- REFCNT = 1
- FLAGS = \\(IOK,pIOK\\)
- IV = 456');
+ Elt "123" HASH = $ADDR' . $c_pattern);
do_test(13,
sub(){@_},