summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-09-18 18:04:01 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-09-18 18:04:01 (GMT)
commit9a4d29bde94d4183ffa1066d4da062e4a2a4e7f2 (patch)
treef856c641275ae74cdc66a55b773dbdb3864eab63 /tests
parent1ad855e68849daccd5c7439bc910d5c694af4227 (diff)
downloadtcl-9a4d29bde94d4183ffa1066d4da062e4a2a4e7f2.zip
tcl-9a4d29bde94d4183ffa1066d4da062e4a2a4e7f2.tar.gz
tcl-9a4d29bde94d4183ffa1066d4da062e4a2a4e7f2.tar.bz2
Make sure large shifts shift for real. [Bug 868467]
Diffstat (limited to 'tests')
-rw-r--r--tests/expr.test12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/expr.test b/tests/expr.test
index 059f7f3..028f56f 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.22 2004/06/23 15:36:56 dkf Exp $
+# RCS: @(#) $Id: expr.test,v 1.23 2004/09/18 18:04:06 dkf Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -860,6 +860,16 @@ test epxr-23.31 {INST_EXPON: special cases} {expr {wide(-1)**wide(-1)}} -1
test epxr-23.32 {INST_EXPON: special cases} {expr {wide(1)**wide(1234567)}} 1
test epxr-23.33 {INST_EXPON: special cases} {expr {wide(2)**wide(-2)}} 0
+# 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
+test expr-24.2 {expr edge cases; shifting} {expr int(5)>>63} 0
+test expr-24.3 {expr edge cases; shifting} {expr wide(5)>>32} 0
+test expr-24.4 {expr edge cases; shifting} {expr wide(5)>>63} 0
+test expr-24.5 {expr edge cases; shifting} {expr int(5)<<32} 0
+test expr-24.6 {expr edge cases; shifting} {expr int(5)<<63} 0
+test expr-24.7 {expr edge cases; shifting} {expr wide(5)<<32} 0
+test expr-24.8 {expr edge cases; shifting} {expr wide(5)<<63} 0
+
# cleanup
if {[info exists a]} {
unset a