diff options
Diffstat (limited to 'tests/expr.test')
-rw-r--r-- | tests/expr.test | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/expr.test b/tests/expr.test index 6ef1c41..b4b6917 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.17.2.1 2003/03/27 13:49:22 dkf Exp $ +# RCS: @(#) $Id: expr.test,v 1.17.2.2 2004/09/18 19:17:13 dkf Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -806,6 +806,17 @@ test expr-22.8 {non-numeric floats} nonPortable { list [catch {expr {1 / Inf}} msg] $msg } {1 {can't use infinite floating-point value as operand of "/"}} +# Some compilers get this wrong; ensure that we work around it correctly +test expr-24.1 {expr edge cases; shifting} {expr int(5)>>31} 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)>>31} 0 +test expr-24.4 {expr edge cases; shifting} {expr wide(5)>>63} 0 +test expr-24.5 {expr edge cases; shifting} nonPortable {expr int(5)<<31} 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)<<31} 10737418240 +test expr-24.8 {expr edge cases; shifting} nonPortable {expr wide(5)<<63} -9223372036854775808 +test expr-24.9 {expr edge cases; shifting} {expr 5>>32} 0 + # cleanup if {[info exists a]} { unset a |