os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/execute.test
Update contrib.
1 # This file contains tests for the tclExecute.c source file. Tests appear
2 # in the same order as the C code that they test. The set of tests is
3 # currently incomplete since it currently includes only new tests for
4 # code changed for the addition of Tcl namespaces. Other execution-
5 # related tests appear in several other test files including
6 # namespace.test, basic.test, eval.test, for.test, etc.
8 # Sourcing this file into Tcl runs the tests and generates output for
9 # errors. No output means no errors were found.
11 # Copyright (c) 1997 Sun Microsystems, Inc.
12 # Copyright (c) 1998-1999 by Scriptics Corporation.
14 # See the file "license.terms" for information on usage and redistribution
15 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
17 # RCS: @(#) $Id: execute.test,v 1.13.2.2 2004/10/28 00:01:07 dgp Exp $
19 if {[lsearch [namespace children] ::tcltest] == -1} {
20 package require tcltest 2
21 namespace import -force ::tcltest::*
24 catch {eval namespace delete [namespace children :: test_ns_*]}
30 ::tcltest::testConstraint testobj \
31 [expr {[info commands testobj] != {} \
32 && [info commands testdoubleobj] != {} \
33 && [info commands teststringobj] != {} \
34 && [info commands testobj] != {}}]
36 ::tcltest::testConstraint longIs32bit \
37 [expr {int(0x80000000) < 0}]
39 # Tests for the omnibus TclExecuteByteCode function:
41 # INST_DONE not tested
42 # INST_PUSH1 not tested
43 # INST_PUSH4 not tested
46 # INST_CONCAT1 not tested
47 # INST_INVOKE_STK4 not tested
48 # INST_INVOKE_STK1 not tested
49 # INST_EVAL_STK not tested
50 # INST_EXPR_STK not tested
54 test execute-1.1 {TclExecuteByteCode, INST_LOAD_SCALAR1, small opnd} {
61 test execute-1.2 {TclExecuteByteCode, INST_LOAD_SCALAR1, large opnd} {
64 for {set i 0} {$i < 129} {incr i} {
65 append body "set x$i x\n"
75 test execute-1.3 {TclExecuteByteCode, INST_LOAD_SCALAR1, error} {
81 list [catch {foo} msg] $msg
82 } {1 {can't read "x": no such variable}}
87 test execute-2.1 {TclExecuteByteCode, INST_LOAD_SCALAR4, simple case} {
89 for {set i 0} {$i < 256} {incr i} {
90 append body "set x$i x\n"
100 test execute-2.2 {TclExecuteByteCode, INST_LOAD_SCALAR4, error} {
102 for {set i 0} {$i < 256} {incr i} {
103 append body "set x$i x\n"
112 list [catch {foo} msg] $msg
113 } {1 {can't read "y": no such variable}}
116 # INST_LOAD_SCALAR_STK not tested
117 # INST_LOAD_ARRAY4 not tested
118 # INST_LOAD_ARRAY1 not tested
119 # INST_LOAD_ARRAY_STK not tested
120 # INST_LOAD_STK not tested
121 # INST_STORE_SCALAR4 not tested
122 # INST_STORE_SCALAR1 not tested
123 # INST_STORE_SCALAR_STK not tested
124 # INST_STORE_ARRAY4 not tested
125 # INST_STORE_ARRAY1 not tested
126 # INST_STORE_ARRAY_STK not tested
127 # INST_STORE_STK not tested
128 # INST_INCR_SCALAR1 not tested
129 # INST_INCR_SCALAR_STK not tested
130 # INST_INCR_STK not tested
131 # INST_INCR_ARRAY1 not tested
132 # INST_INCR_ARRAY_STK not tested
133 # INST_INCR_SCALAR1_IMM not tested
134 # INST_INCR_SCALAR_STK_IMM not tested
135 # INST_INCR_STK_IMM not tested
136 # INST_INCR_ARRAY1_IMM not tested
137 # INST_INCR_ARRAY_STK_IMM not tested
138 # INST_JUMP1 not tested
139 # INST_JUMP4 not tested
140 # INST_JUMP_TRUE4 not tested
141 # INST_JUMP_TRUE1 not tested
142 # INST_JUMP_FALSE4 not tested
143 # INST_JUMP_FALSE1 not tested
144 # INST_LOR not tested
145 # INST_LAND not tested
147 # INST_NEQ not tested
152 # INST_MOD not tested
153 # INST_LSHIFT not tested
154 # INST_RSHIFT not tested
155 # INST_BITOR not tested
156 # INST_BITXOR not tested
157 # INST_BITAND not tested
159 # INST_ADD is partially tested:
160 test execute-3.1 {TclExecuteByteCode, INST_ADD, op1 is int} {testobj} {
161 set x [testintobj set 0 1]
164 test execute-3.2 {TclExecuteByteCode, INST_ADD, op1 is double} {testobj} {
165 set x [testdoubleobj set 0 1]
168 test execute-3.3 {TclExecuteByteCode, INST_ADD, op1 is double with string} {testobj} {
169 set x [testintobj set 0 1]
170 testobj convert 0 double
173 test execute-3.4 {TclExecuteByteCode, INST_ADD, op1 is string int} {testobj} {
174 set x [teststringobj set 0 1]
177 test execute-3.5 {TclExecuteByteCode, INST_ADD, op1 is string double} {testobj} {
178 set x [teststringobj set 0 1.0]
181 test execute-3.6 {TclExecuteByteCode, INST_ADD, op1 is non-numeric} {testobj} {
182 set x [teststringobj set 0 foo]
183 list [catch {expr {$x + 1}} msg] $msg
184 } {1 {can't use non-numeric string as operand of "+"}}
185 test execute-3.7 {TclExecuteByteCode, INST_ADD, op2 is int} {testobj} {
186 set x [testintobj set 0 1]
189 test execute-3.8 {TclExecuteByteCode, INST_ADD, op2 is double} {testobj} {
190 set x [testdoubleobj set 0 1]
193 test execute-3.9 {TclExecuteByteCode, INST_ADD, op2 is double with string} {testobj} {
194 set x [testintobj set 0 1]
195 testobj convert 0 double
198 test execute-3.10 {TclExecuteByteCode, INST_ADD, op2 is string int} {testobj} {
199 set x [teststringobj set 0 1]
202 test execute-3.11 {TclExecuteByteCode, INST_ADD, op2 is string double} {testobj} {
203 set x [teststringobj set 0 1.0]
206 test execute-3.12 {TclExecuteByteCode, INST_ADD, op2 is non-numeric} {testobj} {
207 set x [teststringobj set 0 foo]
208 list [catch {expr {1 + $x}} msg] $msg
209 } {1 {can't use non-numeric string as operand of "+"}}
211 # INST_SUB is partially tested:
212 test execute-3.13 {TclExecuteByteCode, INST_SUB, op1 is int} {testobj} {
213 set x [testintobj set 0 1]
216 test execute-3.14 {TclExecuteByteCode, INST_SUB, op1 is double} {testobj} {
217 set x [testdoubleobj set 0 1]
220 test execute-3.15 {TclExecuteByteCode, INST_SUB, op1 is double with string} {testobj} {
221 set x [testintobj set 0 1]
222 testobj convert 0 double
225 test execute-3.16 {TclExecuteByteCode, INST_SUB, op1 is string int} {testobj} {
226 set x [teststringobj set 0 1]
229 test execute-3.17 {TclExecuteByteCode, INST_SUB, op1 is string double} {testobj} {
230 set x [teststringobj set 0 1.0]
233 test execute-3.18 {TclExecuteByteCode, INST_SUB, op1 is non-numeric} {testobj} {
234 set x [teststringobj set 0 foo]
235 list [catch {expr {$x - 1}} msg] $msg
236 } {1 {can't use non-numeric string as operand of "-"}}
237 test execute-3.19 {TclExecuteByteCode, INST_SUB, op2 is int} {testobj} {
238 set x [testintobj set 0 1]
241 test execute-3.20 {TclExecuteByteCode, INST_SUB, op2 is double} {testobj} {
242 set x [testdoubleobj set 0 1]
245 test execute-3.21 {TclExecuteByteCode, INST_SUB, op2 is double with string} {testobj} {
246 set x [testintobj set 0 1]
247 testobj convert 0 double
250 test execute-3.22 {TclExecuteByteCode, INST_SUB, op2 is string int} {testobj} {
251 set x [teststringobj set 0 1]
254 test execute-3.23 {TclExecuteByteCode, INST_SUB, op2 is string double} {testobj} {
255 set x [teststringobj set 0 1.0]
258 test execute-3.24 {TclExecuteByteCode, INST_SUB, op2 is non-numeric} {testobj} {
259 set x [teststringobj set 0 foo]
260 list [catch {expr {1 - $x}} msg] $msg
261 } {1 {can't use non-numeric string as operand of "-"}}
263 # INST_MULT is partially tested:
264 test execute-3.25 {TclExecuteByteCode, INST_MULT, op1 is int} {testobj} {
265 set x [testintobj set 1 1]
268 test execute-3.26 {TclExecuteByteCode, INST_MULT, op1 is double} {testobj} {
269 set x [testdoubleobj set 1 2.0]
272 test execute-3.27 {TclExecuteByteCode, INST_MULT, op1 is double with string} {testobj} {
273 set x [testintobj set 1 2]
274 testobj convert 1 double
277 test execute-3.28 {TclExecuteByteCode, INST_MULT, op1 is string int} {testobj} {
278 set x [teststringobj set 1 1]
281 test execute-3.29 {TclExecuteByteCode, INST_MULT, op1 is string double} {testobj} {
282 set x [teststringobj set 1 1.0]
285 test execute-3.30 {TclExecuteByteCode, INST_MULT, op1 is non-numeric} {testobj} {
286 set x [teststringobj set 1 foo]
287 list [catch {expr {$x * 1}} msg] $msg
288 } {1 {can't use non-numeric string as operand of "*"}}
289 test execute-3.31 {TclExecuteByteCode, INST_MULT, op2 is int} {testobj} {
290 set x [testintobj set 1 1]
293 test execute-3.32 {TclExecuteByteCode, INST_MULT, op2 is double} {testobj} {
294 set x [testdoubleobj set 1 2.0]
297 test execute-3.33 {TclExecuteByteCode, INST_MULT, op2 is double with string} {testobj} {
298 set x [testintobj set 1 2]
299 testobj convert 1 double
302 test execute-3.34 {TclExecuteByteCode, INST_MULT, op2 is string int} {testobj} {
303 set x [teststringobj set 1 1]
306 test execute-3.35 {TclExecuteByteCode, INST_MULT, op2 is string double} {testobj} {
307 set x [teststringobj set 1 1.0]
310 test execute-3.36 {TclExecuteByteCode, INST_MULT, op2 is non-numeric} {testobj} {
311 set x [teststringobj set 1 foo]
312 list [catch {expr {1 * $x}} msg] $msg
313 } {1 {can't use non-numeric string as operand of "*"}}
315 # INST_DIV is partially tested:
316 test execute-3.37 {TclExecuteByteCode, INST_DIV, op1 is int} {testobj} {
317 set x [testintobj set 1 1]
320 test execute-3.38 {TclExecuteByteCode, INST_DIV, op1 is double} {testobj} {
321 set x [testdoubleobj set 1 2.0]
324 test execute-3.39 {TclExecuteByteCode, INST_DIV, op1 is double with string} {testobj} {
325 set x [testintobj set 1 2]
326 testobj convert 1 double
329 test execute-3.40 {TclExecuteByteCode, INST_DIV, op1 is string int} {testobj} {
330 set x [teststringobj set 1 1]
333 test execute-3.41 {TclExecuteByteCode, INST_DIV, op1 is string double} {testobj} {
334 set x [teststringobj set 1 1.0]
337 test execute-3.42 {TclExecuteByteCode, INST_DIV, op1 is non-numeric} {testobj} {
338 set x [teststringobj set 1 foo]
339 list [catch {expr {$x / 1}} msg] $msg
340 } {1 {can't use non-numeric string as operand of "/"}}
341 test execute-3.43 {TclExecuteByteCode, INST_DIV, op2 is int} {testobj} {
342 set x [testintobj set 1 1]
345 test execute-3.44 {TclExecuteByteCode, INST_DIV, op2 is double} {testobj} {
346 set x [testdoubleobj set 1 1.0]
349 test execute-3.45 {TclExecuteByteCode, INST_DIV, op2 is double with string} {testobj} {
350 set x [testintobj set 1 1]
351 testobj convert 1 double
354 test execute-3.46 {TclExecuteByteCode, INST_DIV, op2 is string int} {testobj} {
355 set x [teststringobj set 1 1]
358 test execute-3.47 {TclExecuteByteCode, INST_DIV, op2 is string double} {testobj} {
359 set x [teststringobj set 1 1.0]
362 test execute-3.48 {TclExecuteByteCode, INST_DIV, op2 is non-numeric} {testobj} {
363 set x [teststringobj set 1 foo]
364 list [catch {expr {1 / $x}} msg] $msg
365 } {1 {can't use non-numeric string as operand of "/"}}
367 # INST_UPLUS is partially tested:
368 test execute-3.49 {TclExecuteByteCode, INST_UPLUS, op is int} {testobj} {
369 set x [testintobj set 1 1]
372 test execute-3.50 {TclExecuteByteCode, INST_UPLUS, op is double} {testobj} {
373 set x [testdoubleobj set 1 1.0]
376 test execute-3.51 {TclExecuteByteCode, INST_UPLUS, op is double with string} {testobj} {
377 set x [testintobj set 1 1]
378 testobj convert 1 double
381 test execute-3.52 {TclExecuteByteCode, INST_UPLUS, op is string int} {testobj} {
382 set x [teststringobj set 1 1]
385 test execute-3.53 {TclExecuteByteCode, INST_UPLUS, op is string double} {testobj} {
386 set x [teststringobj set 1 1.0]
389 test execute-3.54 {TclExecuteByteCode, INST_UPLUS, op is non-numeric} {testobj} {
390 set x [teststringobj set 1 foo]
391 list [catch {expr {+ $x}} msg] $msg
392 } {1 {can't use non-numeric string as operand of "+"}}
394 # INST_UMINUS is partially tested:
395 test execute-3.55 {TclExecuteByteCode, INST_UMINUS, op is int} {testobj} {
396 set x [testintobj set 1 1]
399 test execute-3.56 {TclExecuteByteCode, INST_UMINUS, op is double} {testobj} {
400 set x [testdoubleobj set 1 1.0]
403 test execute-3.57 {TclExecuteByteCode, INST_UMINUS, op is double with string} {testobj} {
404 set x [testintobj set 1 1]
405 testobj convert 1 double
408 test execute-3.58 {TclExecuteByteCode, INST_UMINUS, op is string int} {testobj} {
409 set x [teststringobj set 1 1]
412 test execute-3.59 {TclExecuteByteCode, INST_UMINUS, op is string double} {testobj} {
413 set x [teststringobj set 1 1.0]
416 test execute-3.60 {TclExecuteByteCode, INST_UMINUS, op is non-numeric} {testobj} {
417 set x [teststringobj set 1 foo]
418 list [catch {expr {- $x}} msg] $msg
419 } {1 {can't use non-numeric string as operand of "-"}}
421 # INST_LNOT is partially tested:
422 test execute-3.61 {TclExecuteByteCode, INST_LNOT, op is int} {testobj} {
423 set x [testintobj set 1 2]
426 test execute-3.62 {TclExecuteByteCode, INST_LNOT, op is int} {testobj} {
427 set x [testintobj set 1 0]
430 test execute-3.63 {TclExecuteByteCode, INST_LNOT, op is double} {testobj} {
431 set x [testdoubleobj set 1 1.0]
434 test execute-3.64 {TclExecuteByteCode, INST_LNOT, op is double} {testobj} {
435 set x [testdoubleobj set 1 0.0]
438 test execute-3.65 {TclExecuteByteCode, INST_LNOT, op is double with string} {testobj} {
439 set x [testintobj set 1 1]
440 testobj convert 1 double
443 test execute-3.66 {TclExecuteByteCode, INST_LNOT, op is double with string} {testobj} {
444 set x [testintobj set 1 0]
445 testobj convert 1 double
448 test execute-3.67 {TclExecuteByteCode, INST_LNOT, op is string int} {testobj} {
449 set x [teststringobj set 1 1]
452 test execute-3.68 {TclExecuteByteCode, INST_LNOT, op is string int} {testobj} {
453 set x [teststringobj set 1 0]
456 test execute-3.69 {TclExecuteByteCode, INST_LNOT, op is string double} {testobj} {
457 set x [teststringobj set 1 1.0]
460 test execute-3.70 {TclExecuteByteCode, INST_LNOT, op is string double} {testobj} {
461 set x [teststringobj set 1 0.0]
464 test execute-3.71 {TclExecuteByteCode, INST_LNOT, op is non-numeric} {testobj} {
465 set x [teststringobj set 1 foo]
466 list [catch {expr {! $x}} msg] $msg
467 } {1 {can't use non-numeric string as operand of "!"}}
469 # INST_BITNOT not tested
470 # INST_CALL_BUILTIN_FUNC1 not tested
471 # INST_CALL_FUNC1 not tested
473 # INST_TRY_CVT_TO_NUMERIC is partially tested:
474 test execute-3.72 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is int} {testobj} {
475 set x [testintobj set 1 1]
478 test execute-3.73 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is double} {testobj} {
479 set x [testdoubleobj set 1 1.0]
482 test execute-3.74 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is double with string} {testobj} {
483 set x [testintobj set 1 1]
484 testobj convert 1 double
487 test execute-3.75 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is string int} {testobj} {
488 set x [teststringobj set 1 1]
491 test execute-3.76 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is string double} {testobj} {
492 set x [teststringobj set 1 1.0]
495 test execute-3.77 {TclExecuteByteCode, INST_TRY_CVT_TO_NUMERIC, op is non-numeric} {testobj} {
496 set x [teststringobj set 1 foo]
500 # INST_BREAK not tested
501 # INST_CONTINUE not tested
502 # INST_FOREACH_START4 not tested
503 # INST_FOREACH_STEP4 not tested
504 # INST_BEGIN_CATCH4 not tested
505 # INST_END_CATCH not tested
506 # INST_PUSH_RESULT not tested
507 # INST_PUSH_RETURN_CODE not tested
509 test execute-4.1 {Tcl_GetCommandFromObj, convert to tclCmdNameType} {
510 catch {eval namespace delete [namespace children :: test_ns_*]}
513 namespace eval test_ns_1 {
514 namespace export cmd1
515 proc cmd1 {args} {return "cmd1: $args"}
516 proc cmd2 {args} {return "cmd2: $args"}
518 namespace eval test_ns_1::test_ns_2 {
519 namespace import ::test_ns_1::*
523 list [namespace which -command ${x}${y}cmd1] \
524 [catch {namespace which -command ${x}${y}cmd2} msg] $msg \
525 [catch {namespace which -command ${x}${y}:cmd2} msg] $msg
526 } {::test_ns_1::test_ns_2::cmd1 0 {} 0 {}}
527 test execute-4.2 {Tcl_GetCommandFromObj, check if cached tclCmdNameType is invalid} {
528 catch {eval namespace delete [namespace children :: test_ns_*]}
529 catch {rename foo ""}
534 namespace eval test_ns_1 {
536 return [namespace which -command foo]
540 lappend l [test_ns_1::whichFoo]
541 namespace eval test_ns_1 {
543 return "namespace foo"
546 lappend l [test_ns_1::whichFoo]
548 } {::foo ::test_ns_1::foo}
549 test execute-4.3 {Tcl_GetCommandFromObj, command never found} {
550 catch {eval namespace delete [namespace children :: test_ns_*]}
551 catch {rename foo ""}
552 namespace eval test_ns_1 {
554 return "namespace foo"
557 namespace eval test_ns_1 {
559 return "namespace foo"
562 list [namespace eval test_ns_1 {namespace which -command foo}] \
563 [rename test_ns_1::foo ""] \
564 [catch {namespace eval test_ns_1 {namespace which -command foo}} msg] $msg
565 } {::test_ns_1::foo {} 0 {}}
567 test execute-5.1 {SetCmdNameFromAny, set cmd name to empty heap string if NULL} {
568 catch {eval namespace delete [namespace children :: test_ns_*]}
570 proc {} {} {return {}}
577 test execute-6.1 {UpdateStringOfCmdName: called for duplicate of empty cmdName object} {
589 test execute-6.2 {Evaluate an expression in a variable; compile the first time, do not the second} {
591 proc a {obj} {expr $obj}
592 set res "[a $w]:[a $w]"
595 test execute-7.0 {Wide int handling in INST_JUMP_FALSE/LAND} {longIs32bit} {
599 test execute-7.1 {Wide int handling in INST_JUMP_FALSE/LAND} {longIs32bit} {
600 expr {0x100000000 && 1}
602 test execute-7.2 {Wide int handling in INST_JUMP_FALSE/LAND} {longIs32bit} {
603 expr {1 && 0x100000000}
605 test execute-7.3 {Wide int handling in INST_JUMP_FALSE/LAND} {longIs32bit} {
606 expr {wide(0x100000000) && 1}
608 test execute-7.4 {Wide int handling in INST_JUMP_FALSE/LAND} {longIs32bit} {
609 expr {1 && wide(0x100000000)}
611 test execute-7.5 {Wide int handling in INST_EQ} {longIs32bit} {
612 expr {4 == (wide(1)+wide(3))}
614 test execute-7.6 {Wide int handling in INST_EQ and [incr]} {longIs32bit} {
616 expr {400000000000 == [incr x]}
618 # wide ints have more bits of precision than doubles, but we convert anyway
619 test execute-7.7 {Wide int handling in INST_EQ and [incr]} {longIs32bit} {
620 set x [expr {wide(1)<<62}]
622 expr {double($x) == double($y)}
624 test execute-7.8 {Wide int conversions can change sign} {longIs32bit} {
626 expr {int($x) < wide($x)}
628 test execute-7.9 {Wide int handling in INST_MOD} {longIs32bit} {
629 expr {(wide(1)<<60) % ((wide(47)<<45)-1)}
631 test execute-7.10 {Wide int handling in INST_MOD} {longIs32bit} {
632 expr {((wide(1)<<60)-1) % 0x400000000}
634 test execute-7.11 {Wide int handling in INST_LSHIFT} {longIs32bit} {
637 test execute-7.12 {Wide int handling in INST_LSHIFT} {longIs32bit} {
640 test execute-7.13 {Wide int handling in INST_RSHIFT} {longIs32bit} {
641 expr 0x543210febcda9876>>7
643 test execute-7.14 {Wide int handling in INST_RSHIFT} {longIs32bit} {
644 expr 0x9876543210febcda>>7
646 test execute-7.15 {Wide int handling in INST_BITOR} {longIs32bit} {
647 expr 0x9876543210febcda | 0x543210febcda9876
648 } -2560765885044310786
649 test execute-7.16 {Wide int handling in INST_BITXOR} {longIs32bit} {
650 expr 0x9876543210febcda ^ 0x543210febcda9876
651 } -3727778945703861076
652 test execute-7.17 {Wide int handling in INST_BITAND} {longIs32bit} {
653 expr 0x9876543210febcda & 0x543210febcda9876
654 } 1167013060659550290
655 test execute-7.18 {Wide int handling in INST_ADD} {longIs32bit} {
656 expr wide(0x7fffffff)+wide(0x7fffffff)
658 test execute-7.19 {Wide int handling in INST_ADD} {longIs32bit} {
659 expr 0x7fffffff+wide(0x7fffffff)
661 test execute-7.20 {Wide int handling in INST_ADD} {longIs32bit} {
662 expr wide(0x7fffffff)+0x7fffffff
664 test execute-7.21 {Wide int handling in INST_ADD} {longIs32bit} {
665 expr double(0x7fffffff)+wide(0x7fffffff)
667 test execute-7.22 {Wide int handling in INST_ADD} {longIs32bit} {
668 expr wide(0x7fffffff)+double(0x7fffffff)
670 test execute-7.23 {Wide int handling in INST_SUB} {longIs32bit} {
671 expr 0x123456789a-0x20406080a
673 test execute-7.24 {Wide int handling in INST_MULT} {longIs32bit} {
674 expr 0x123456789a*193
676 test execute-7.25 {Wide int handling in INST_DIV} {longIs32bit} {
677 expr 0x123456789a/193
679 test execute-7.26 {Wide int handling in INST_UPLUS} {longIs32bit} {
680 set x 0x123456871234568
683 test execute-7.27 {Wide int handling in INST_UMINUS} {longIs32bit} {
684 set x 0x123456871234568
687 test execute-7.28 {Wide int handling in INST_LNOT} {longIs32bit} {
688 set x 0x123456871234568
691 test execute-7.29 {Wide int handling in INST_BITNOT} {longIs32bit} {
692 set x 0x123456871234568
695 test execute-7.30 {Wide int handling in function call} {longIs32bit} {
696 set x 0x12345687123456
698 expr {log($x) == log(double($x))}
700 test execute-7.31 {Wide int handling in abs()} {longIs32bit} {
701 set x 0xa23456871234568
703 set y 0x123456871234568
704 concat [expr {abs($x)}] [expr {abs($y)}]
705 } {730503879441204585 81985533099853160}
706 test execute-7.32 {Wide int handling} {longIs32bit} {
707 expr {1024 * 1024 * 1024 * 1024}
709 test execute-7.33 {Wide int handling} {longIs32bit} {
710 expr {0x1 * 1024 * 1024 * 1024 * 1024}
712 test execute-7.34 {Wide int handling} {longIs32bit} {
713 expr {wide(0x1) * 1024 * 1024 * 1024 * 1024}
716 test execute-8.1 {Stack protection} -setup {
717 # If [Bug #804681] has not been properly
718 # taken care of, this should segfault
719 proc whatever args {llength $args}
720 trace add variable ::errorInfo {write unset} whatever
724 trace remove variable ::errorInfo {write unset} whatever
726 } -returnCodes error -match glob -result *
729 if {[info commands testobj] != {}} {
732 catch {eval namespace delete [namespace children :: test_ns_*]}
733 catch {rename foo ""}
736 catch {rename { } ""}
740 ::tcltest::cleanupTests