summaryrefslogtreecommitdiffstats
path: root/tests/expr.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2006-07-26 21:56:34 (GMT)
committerdgp <dgp@users.sourceforge.net>2006-07-26 21:56:34 (GMT)
commit420e232f0fb6221fb1473b08681d9b2a76804690 (patch)
tree725277dd32485ba803542bc6c6d9cfbdf15557c8 /tests/expr.test
parent7bef47d44562d1078457fd681f39a40e54d43897 (diff)
downloadtcl-420e232f0fb6221fb1473b08681d9b2a76804690.zip
tcl-420e232f0fb6221fb1473b08681d9b2a76804690.tar.gz
tcl-420e232f0fb6221fb1473b08681d9b2a76804690.tar.bz2
* generic/tclExecute.c: Corrected flawed overflow detection in
* tests/expr.test: INST_EXPON that caused [expr 2**64] to return 0 instead of the same value as [expr 1<<64].
Diffstat (limited to 'tests/expr.test')
-rw-r--r--tests/expr.test6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/expr.test b/tests/expr.test
index 980f0b9..faca569 100644
--- a/tests/expr.test
+++ b/tests/expr.test
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: expr.test,v 1.55 2006/07/05 05:34:45 dgp Exp $
+# RCS: @(#) $Id: expr.test,v 1.56 2006/07/26 21:56:35 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2.1
@@ -1032,6 +1032,10 @@ test expr-23.39 {INST_EXPON: big integer} {
expr 1[string repeat 0 30]**2
} 1[string repeat 0 60]
test expr-23.40 {INST_EXPON: overflow to big integer} {expr {(-10)**3}} -1000
+test expr-23.41 {INST_EXPON: overflow to big integer} {expr 2**64} [expr 1<<64]
+test expr-23.41 {INST_EXPON: overflow to big integer} {expr 4**32} [expr 1<<64]
+test expr-23.41 {INST_EXPON: overflow to big integer} {expr 16**16} [expr 1<<64]
+test expr-23.41 {INST_EXPON: overflow to big integer} {expr 256**8} [expr 1<<64]
# Some compilers get this wrong; ensure that we work around it correctly
test expr-24.1 {expr edge cases; shifting} {expr int(5)>>32} 0