Commit | Line | Data |
---|---|---|
ef44eed1 SS |
1 | # Copyright (C) 1988, 1990, 1991, 1992 Free Software Foundation, Inc. |
2 | ||
3 | # This program is free software; you can redistribute it and/or modify | |
4 | # it under the terms of the GNU General Public License as published by | |
5 | # the Free Software Foundation; either version 2 of the License, or | |
6 | # (at your option) any later version. | |
7 | # | |
8 | # This program is distributed in the hope that it will be useful, | |
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | # GNU General Public License for more details. | |
12 | # | |
13 | # You should have received a copy of the GNU General Public License | |
14 | # along with this program; if not, write to the Free Software | |
15 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
16 | ||
17 | # Please email any bugs, comments, and/or additions to this file to: | |
18 | # bug-gdb@prep.ai.mit.edu | |
19 | ||
20 | # This file was written by Rob Savoye. (rob@cygnus.com) | |
21 | ||
22 | if $tracelevel then { | |
23 | strace $tracelevel | |
24 | } | |
25 | ||
26 | # | |
27 | # test running programs | |
28 | # | |
29 | set prms_id 0 | |
30 | set bug_id 0 | |
31 | ||
32 | set binfile "exprs" | |
33 | ||
34 | if ![file exists $objdir/$subdir/$binfile] then { | |
35 | perror "$objdir/$subdir/$binfile does not exist." | |
36 | return 0 | |
37 | } | |
38 | ||
39 | gdb_exit | |
40 | gdb_start | |
41 | gdb_reinitialize_dir $srcdir/$subdir | |
42 | gdb_load $objdir/$subdir/$binfile | |
43 | ||
44 | # | |
45 | # set it up at a breakpoint so we can play with the variable values | |
46 | # | |
47 | ||
48 | if ![runto main] then { | |
49 | perror "couldn't run to breakpoint" | |
50 | continue | |
51 | } | |
52 | ||
53 | # | |
54 | # test expressions with "char" types | |
55 | # | |
56 | send "set variable v_char=127\n" | |
57 | expect { | |
58 | -re "set.*$prompt $" { | |
59 | send "print v_char == 0\n" | |
60 | expect { | |
61 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
62 | send "print v_char == 127\n" | |
63 | expect { | |
64 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print char ==" } | |
65 | -re "$prompt $" { fail "print char ==" } | |
66 | timeout { fail "(timeout) print char ==" } | |
67 | } | |
68 | } | |
69 | -re "$prompt $" { fail "print char ==" } | |
70 | timeout { fail "(timeout) print char ==" } | |
71 | } | |
72 | } | |
73 | -re "$prompt $" { fail "print char ==" } | |
74 | timeout { fail "(timeout) print char ==" } | |
75 | } | |
76 | ||
77 | ||
78 | send "set variable v_char=127\n" | |
79 | expect { | |
80 | -re "set.*$prompt $" { | |
81 | send "print v_char != 0\n" | |
82 | expect { | |
83 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
84 | send "print v_char != 127\n" | |
85 | expect { | |
86 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print char !=" } | |
87 | -re "$prompt $" { fail "print char !=" } | |
88 | timeout { fail "(timeout) print char !=" } | |
89 | } | |
90 | } | |
91 | -re "$prompt $" { fail "print char !=" } | |
92 | timeout { fail "(timeout) print char !=" } | |
93 | } | |
94 | } | |
95 | -re "$prompt $" { fail "print char !=" } | |
96 | timeout { fail "(timeout) print char !=" } | |
97 | } | |
98 | ||
99 | ||
100 | send "set variable v_char=127\n" | |
101 | expect { | |
102 | -re "set.*$prompt $" { | |
103 | send "print v_char < 0\n" | |
104 | expect { | |
105 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
106 | send "print v_char < 127\n" | |
107 | expect { | |
108 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print char <" } | |
109 | -re "$prompt $" { fail "print char <" } | |
110 | timeout { fail "(timeout) print char <" } | |
111 | } | |
112 | } | |
113 | -re "$prompt $" { fail "print char <" } | |
114 | timeout { fail "(timeout) print char <" } | |
115 | } | |
116 | } | |
117 | -re "$prompt $" { fail "print char <" } | |
118 | timeout { fail "(timeout) print char <" } | |
119 | } | |
120 | ||
121 | ||
122 | send "set variable v_char=127\n" | |
123 | expect { | |
124 | -re "set.*$prompt $" { | |
125 | send "print v_char > 0\n" | |
126 | expect { | |
127 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
128 | send "print v_char > 127\n" | |
129 | expect { | |
130 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print char >" } | |
131 | -re "$prompt $" { fail "print char >" } | |
132 | timeout { fail "(timeout) print char >" } | |
133 | } | |
134 | } | |
135 | -re "$prompt $" { fail "print char >" } | |
136 | timeout { fail "(timeout) print char >" } | |
137 | } | |
138 | } | |
139 | -re "$prompt $" { fail "print char >" } | |
140 | timeout { fail "(timeout) print char >" } | |
141 | } | |
142 | ||
143 | ||
144 | # | |
145 | # test expressions with "signed char" types | |
146 | # | |
147 | send "set variable v_signed_char=127\n" | |
148 | expect { | |
149 | -re "set.*$prompt $" { | |
150 | send "print v_signed_char == 0\n" | |
151 | expect { | |
152 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
153 | send "print v_signed_char == 127\n" | |
154 | expect { | |
155 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print signed char ==" } | |
156 | -re "$prompt $" { fail "print signed char ==" } | |
157 | timeout { fail "(timeout) print signed char ==" } | |
158 | } | |
159 | } | |
160 | -re "$prompt $" { fail "print signed char ==" } | |
161 | timeout { fail "(timeout) print signed char ==" } | |
162 | } | |
163 | } | |
164 | -re "$prompt $" { fail "print signed char ==" } | |
165 | timeout { fail "(timeout) print signed char ==" } | |
166 | } | |
167 | ||
168 | ||
169 | send "set variable v_signed_char=127\n" | |
170 | expect { | |
171 | -re "set.*$prompt $" { | |
172 | send "print v_signed_char != 0\n" | |
173 | expect { | |
174 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
175 | send "print v_signed_char != 127\n" | |
176 | expect { | |
177 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed char !=" } | |
178 | -re "$prompt $" { fail "print signed char !=" } | |
179 | timeout { fail "(timeout) print signed char !=" } | |
180 | } | |
181 | } | |
182 | -re "$prompt $" { fail "print signed char !=" } | |
183 | timeout { fail "(timeout) print signed char !=" } | |
184 | } | |
185 | } | |
186 | -re "$prompt $" { fail "print signed char !=" } | |
187 | timeout { fail "(timeout) print signed char !=" } | |
188 | } | |
189 | ||
190 | ||
191 | send "set variable v_signed_char=127\n" | |
192 | expect { | |
193 | -re "set.*$prompt $" { | |
194 | send "print v_signed_char < 0\n" | |
195 | expect { | |
196 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
197 | send "print v_signed_char < 127\n" | |
198 | expect { | |
199 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed char <" } | |
200 | -re "$prompt $" { fail "print signed char <" } | |
201 | timeout { fail "(timeout) print signed char <" } | |
202 | } | |
203 | } | |
204 | -re "$prompt $" { fail "print signed char <" } | |
205 | timeout { fail "(timeout) print signed char <" } | |
206 | } | |
207 | } | |
208 | -re "$prompt $" { fail "print signed char <" } | |
209 | timeout { fail "(timeout) print signed char <" } | |
210 | } | |
211 | ||
212 | ||
213 | send "set variable v_signed_char=127\n" | |
214 | expect { | |
215 | -re "set.*$prompt $" { | |
216 | send "print v_signed_char > 0\n" | |
217 | expect { | |
218 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
219 | send "print v_signed_char > 127\n" | |
220 | expect { | |
221 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed char >" } | |
222 | -re "$prompt $" { fail "print signed char >" } | |
223 | timeout { fail "(timeout) print signed char >" } | |
224 | } | |
225 | } | |
226 | -re "$prompt $" { fail "print signed char >" } | |
227 | timeout { fail "(timeout) print signed char >" } | |
228 | } | |
229 | } | |
230 | -re "$prompt $" { fail "print signed char >" } | |
231 | timeout { fail "(timeout) print signed char >" } | |
232 | } | |
233 | ||
234 | ||
235 | # make char a minus | |
236 | send "set variable v_signed_char=-1\n" | |
237 | expect { | |
238 | -re "set.*$prompt $" { | |
239 | send "print v_signed_char == 0\n" | |
240 | expect { | |
241 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
242 | send "print v_signed_char == -1\n" | |
243 | expect { | |
244 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print signed char == (minus)" } | |
245 | -re "$prompt $" { fail "print signed char == (minus)" } | |
246 | timeout { fail "(timeout) print signed char == (minus)" } | |
247 | } | |
248 | } | |
249 | -re "$prompt $" { fail "print signed char == (minus)" } | |
250 | timeout { fail "(timeout) print signed char == (minus)" } | |
251 | } | |
252 | } | |
253 | -re "$prompt $" { fail "print signed char == (minus)" } | |
254 | timeout { fail "(timeout) print signed char == (minus)" } | |
255 | } | |
256 | ||
257 | ||
258 | send "set variable v_signed_char=-1\n" | |
259 | expect { | |
260 | -re "set.*$prompt $" { | |
261 | send "print v_signed_char != 0\n" | |
262 | expect { | |
263 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
264 | send "print v_signed_char != -1\n" | |
265 | expect { | |
266 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed char != (minus)" } | |
267 | -re "$prompt $" { fail "print signed char != (minus)" } | |
268 | timeout { fail "(timeout) print signed char != (minus)" } | |
269 | } | |
270 | } | |
271 | -re "$prompt $" { fail "print signed char != (minus)" } | |
272 | timeout { fail "(timeout) print signed char != (minus)" } | |
273 | } | |
274 | } | |
275 | -re "$prompt $" { fail "print signed char != (minus)" } | |
276 | timeout { fail "(timeout) print signed char != (minus)" } | |
277 | } | |
278 | ||
279 | ||
280 | send "set variable v_signed_char=-1\n" | |
281 | expect { | |
282 | -re "set.*$prompt $" { | |
283 | send "print v_signed_char < 0\n" | |
284 | expect { | |
285 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
286 | send "print v_signed_char < 127\n" | |
287 | expect { | |
288 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print signed char < (minus)" } | |
289 | -re "$prompt $" { fail "print signed char < (minus)" } | |
290 | timeout { fail "(timeout) print signed char < (minus)" } | |
291 | } | |
292 | } | |
293 | -re "$prompt $" { fail "print signed char < (minus)" } | |
294 | timeout { fail "(timeout) print signed char < (minus)" } | |
295 | } | |
296 | } | |
297 | -re "$prompt $" { fail "print signed char < (minus)" } | |
298 | timeout { fail "(timeout) print signed char < (minus)" } | |
299 | } | |
300 | ||
301 | ||
302 | send "set variable v_signed_char=-1\n" | |
303 | expect { | |
304 | -re "set.*$prompt $" { | |
305 | send "print v_signed_char > 0\n" | |
306 | expect { | |
307 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
308 | send "print v_signed_char > 127\n" | |
309 | expect { | |
310 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed char > (minus)" } | |
311 | -re "$prompt $" { fail "print signed char > (minus)" } | |
312 | timeout { fail "(timeout) print signed char > (minus)" } | |
313 | } | |
314 | } | |
315 | -re "$prompt $" { fail "print signed char > (minus)" } | |
316 | timeout { fail "(timeout) print signed char > (minus)" } | |
317 | } | |
318 | } | |
319 | -re "$prompt $" { fail "print signed char > (minus)" } | |
320 | timeout { fail "(timeout) print signed char > (minus)" } | |
321 | } | |
322 | ||
323 | ||
324 | # | |
325 | # test expressions with "unsigned char" types | |
326 | # | |
327 | send "set variable v_unsigned_char=127\n" | |
328 | expect { | |
329 | -re "set.*$prompt $" { | |
330 | send "print v_unsigned_char == 0\n" | |
331 | expect { | |
332 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
333 | send "print v_unsigned_char == 127\n" | |
334 | expect { | |
335 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print unsigned char ==" } | |
336 | -re "$prompt $" { fail "print unsigned char ==" } | |
337 | timeout { fail "(timeout) print unsigned char ==" } | |
338 | } | |
339 | } | |
340 | -re "$prompt $" { fail "print unsigned char ==" } | |
341 | timeout { fail "(timeout) print unsigned char ==" } | |
342 | } | |
343 | } | |
344 | -re "$prompt $" { fail "print unsigned char ==" } | |
345 | timeout { fail "(timeout) print unsigned char ==" } | |
346 | } | |
347 | ||
348 | ||
349 | send "set variable v_unsigned_char=127\n" | |
350 | expect { | |
351 | -re "set.*$prompt $" { | |
352 | send "print v_unsigned_char != 0\n" | |
353 | expect { | |
354 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
355 | send "print v_unsigned_char != 127\n" | |
356 | expect { | |
357 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print unsigned char !=" } | |
358 | -re "$prompt $" { fail "print unsigned char !=" } | |
359 | timeout { fail "(timeout) print unsigned char !=" } | |
360 | } | |
361 | } | |
362 | -re "$prompt $" { fail "print unsigned char !=" } | |
363 | timeout { fail "(timeout) print unsigned char !=" } | |
364 | } | |
365 | } | |
366 | -re "$prompt $" { fail "print unsigned char !=" } | |
367 | timeout { fail "(timeout) print unsigned char !=" } | |
368 | } | |
369 | ||
370 | ||
371 | send "set variable v_unsigned_char=127\n" | |
372 | expect { | |
373 | -re "set.*$prompt $" { | |
374 | send "print v_unsigned_char < 0\n" | |
375 | expect { | |
376 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
377 | send "print v_unsigned_char < 127\n" | |
378 | expect { | |
379 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print unsigned char <" } | |
380 | -re "$prompt $" { fail "print unsigned char <" } | |
381 | timeout { fail "(timeout) print unsigned char <" } | |
382 | } | |
383 | } | |
384 | -re "$prompt $" { fail "print unsigned char <" } | |
385 | timeout { fail "(timeout) print unsigned char <" } | |
386 | } | |
387 | } | |
388 | -re "$prompt $" { fail "print unsigned char <" } | |
389 | timeout { fail "(timeout) print unsigned char <" } | |
390 | } | |
391 | ||
392 | ||
393 | send "set variable v_unsigned_char=127\n" | |
394 | expect { | |
395 | -re "set.*$prompt $" { | |
396 | send "print v_unsigned_char > 0\n" | |
397 | expect { | |
398 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
399 | send "print v_unsigned_char > 127\n" | |
400 | expect { | |
401 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print unsigned char >" } | |
402 | -re "$prompt $" { fail "print unsigned char >" } | |
403 | timeout { fail "(timeout) print unsigned char >" } | |
404 | } | |
405 | } | |
406 | -re "$prompt $" { fail "print unsigned char >" } | |
407 | timeout { fail "(timeout) print unsigned char >" } | |
408 | } | |
409 | } | |
410 | -re "$prompt $" { fail "print unsigned char >" } | |
411 | timeout { fail "(timeout) print unsigned char >" } | |
412 | } | |
413 | ||
414 | ||
415 | # make char a minus | |
416 | # FIXME: gdb mishandles the cast (unsigned char) on the i960, so I've | |
417 | # set up an expected failure for this case. | |
418 | send "set variable v_unsigned_char=~0\n" | |
419 | expect { | |
420 | -re "set.*$prompt $" { | |
421 | send "print v_unsigned_char == 0\n" | |
422 | expect { | |
423 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
424 | send "print v_unsigned_char == ~0\n" | |
425 | expect { | |
426 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
427 | setup_xfail "i960-*-*" 1821 | |
428 | send "print v_unsigned_char == (unsigned char)~0\n" | |
429 | expect { | |
430 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print unsigned char == (~0)" } | |
431 | -re "$prompt $" { fail "print unsigned char == (~0)" } | |
432 | timeout { fail "(timeout) print unsigned char == (~0)" } | |
433 | } | |
434 | } | |
435 | -re "$prompt $" { fail "print unsigned char == (~0)" } | |
436 | timeout { fail "(timeout) print unsigned char == (~0)" } | |
437 | } | |
438 | } | |
439 | -re "$prompt $" { fail "print unsigned char == (~0)" } | |
440 | timeout { fail "(timeout) print unsigned char == (~0)" } | |
441 | } | |
442 | } | |
443 | -re "$prompt $" { fail "print unsigned char == (~0)" } | |
444 | timeout { fail "(timeout) print unsigned char == (~0)" } | |
445 | } | |
446 | ||
447 | ||
448 | # FIXME: gdb mishandles the cast (unsigned char) on the i960, so I've | |
449 | # set up an expected failure for this case. | |
450 | send "set variable v_unsigned_char=~0\n" | |
451 | expect { | |
452 | -re "set.*$prompt $" { | |
453 | send "print v_unsigned_char != 0\n" | |
454 | expect { | |
455 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
456 | setup_xfail "i960-*-*" 1821 | |
457 | send "print v_unsigned_char != (unsigned char)~0\n" | |
458 | expect { | |
459 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print unsigned char != (~0)" } | |
460 | -re "$prompt $" { fail "print unsigned char != (~0)" } | |
461 | timeout { fail "(timeout) print unsigned char != (~0)" } | |
462 | } | |
463 | } | |
464 | -re "$prompt $" { fail "print unsigned char != (~0)" } | |
465 | timeout { fail "(timeout) print unsigned char != (~0)" } | |
466 | } | |
467 | } | |
468 | -re "$prompt $" { fail "print unsigned char != (~0)" } | |
469 | timeout { fail "(timeout) print unsigned char != (~0)" } | |
470 | } | |
471 | ||
472 | ||
473 | send "set variable v_unsigned_char=~0\n" | |
474 | expect { | |
475 | -re "set.*$prompt $" { | |
476 | send "print v_unsigned_char < 0\n" | |
477 | expect { | |
478 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
479 | send "print v_unsigned_char < 127\n" | |
480 | expect { | |
481 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print unsigned char < (~0)" } | |
482 | -re "$prompt $" { fail "print unsigned char < (~0)" } | |
483 | timeout { fail "(timeout) print unsigned char < (~0)" } | |
484 | } | |
485 | } | |
486 | -re "$prompt $" { fail "print unsigned char < (~0)" } | |
487 | timeout { fail "(timeout) print unsigned char < (~0)" } | |
488 | } | |
489 | } | |
490 | -re "$prompt $" { fail "print unsigned char < (~0)" } | |
491 | timeout { fail "(timeout) print unsigned char < (~0)" } | |
492 | } | |
493 | ||
494 | ||
495 | send "set variable v_unsigned_char=~0\n" | |
496 | expect { | |
497 | -re "set.*$prompt $" { | |
498 | send "print v_unsigned_char > 0\n" | |
499 | expect { | |
500 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
501 | send "print v_unsigned_char > 127\n" | |
502 | expect { | |
503 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print unsigned char > (~0)" } | |
504 | -re "$prompt $" { fail "print unsigned char > (~0)" } | |
505 | timeout { fail "(timeout) print unsigned char > (~0)" } | |
506 | } | |
507 | } | |
508 | -re "$prompt $" { fail "print unsigned char > (~0)" } | |
509 | timeout { fail "(timeout) print unsigned char > (~0)" } | |
510 | } | |
511 | } | |
512 | -re "$prompt $" { fail "print unsigned char > (~0)" } | |
513 | timeout { fail "(timeout) print unsigned char > (~0)" } | |
514 | } | |
515 | ||
516 | ||
517 | # | |
518 | # test expressions with "short" types | |
519 | # | |
520 | send "set variable v_short=0x7FFF\n" | |
521 | expect { | |
522 | -re "set.*$prompt $" { | |
523 | send "print v_short == 0\n" | |
524 | expect { | |
525 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
526 | send "print v_short == 0x7FFF\n" | |
527 | expect { | |
528 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print signed short ==" } | |
529 | -re "$prompt $" { fail "print signed short ==" } | |
530 | timeout { fail "(timeout) print signed short ==" } | |
531 | } | |
532 | } | |
533 | -re "$prompt $" { fail "print signed short ==" } | |
534 | timeout { fail "(timeout) print signed short ==" } | |
535 | } | |
536 | } | |
537 | -re "$prompt $" { fail "print signed short ==" } | |
538 | timeout { fail "(timeout) print signed short ==" } | |
539 | } | |
540 | ||
541 | ||
542 | send "set variable v_short=0x7FFF\n" | |
543 | expect { | |
544 | -re "set.*$prompt $" { | |
545 | send "print v_short != 0\n" | |
546 | expect { | |
547 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
548 | send "print v_short != 0x7FFF\n" | |
549 | expect { | |
550 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed short !=" } | |
551 | -re "$prompt $" { fail "print signed short !=" } | |
552 | timeout { fail "(timeout) print signed short !=" } | |
553 | } | |
554 | } | |
555 | -re "$prompt $" { fail "print signed short !=" } | |
556 | timeout { fail "(timeout) print signed short !=" } | |
557 | } | |
558 | } | |
559 | -re "$prompt $" { fail "print signed short !=" } | |
560 | timeout { fail "(timeout) print signed short !=" } | |
561 | } | |
562 | ||
563 | ||
564 | send "set variable v_short=0x7FFF\n" | |
565 | expect { | |
566 | -re "set.*$prompt $" { | |
567 | send "print v_short < 0\n" | |
568 | expect { | |
569 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
570 | send "print v_short < 0x7FFF\n" | |
571 | expect { | |
572 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed short <" } | |
573 | -re "$prompt $" { fail "print signed short <" } | |
574 | timeout { fail "(timeout) print signed short <" } | |
575 | } | |
576 | } | |
577 | -re "$prompt $" { fail "print signed short <" } | |
578 | timeout { fail "(timeout) print signed short <" } | |
579 | } | |
580 | } | |
581 | -re "$prompt $" { fail "print signed short <" } | |
582 | timeout { fail "(timeout) print signed short <" } | |
583 | } | |
584 | ||
585 | ||
586 | send "set variable v_short=0x7FFF\n" | |
587 | expect { | |
588 | -re "set.*$prompt $" { | |
589 | send "print v_short > 0\n" | |
590 | expect { | |
591 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
592 | send "print v_short > 0x7FFF\n" | |
593 | expect { | |
594 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed short >" } | |
595 | -re "$prompt $" { fail "print signed short >" } | |
596 | timeout { fail "(timeout) print signed short >" } | |
597 | } | |
598 | } | |
599 | -re "$prompt $" { fail "print signed short >" } | |
600 | timeout { fail "(timeout) print signed short >" } | |
601 | } | |
602 | } | |
603 | -re "$prompt $" { fail "print signed short >" } | |
604 | timeout { fail "(timeout) print signed short >" } | |
605 | } | |
606 | ||
607 | ||
608 | # make short a minus | |
609 | send "set variable v_short=-1\n" | |
610 | expect { | |
611 | -re "set.*$prompt $" { | |
612 | send "print v_short == 0\n" | |
613 | expect { | |
614 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
615 | send "print v_short == -1\n" | |
616 | expect { | |
617 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print signed short == (minus)" } | |
618 | -re "$prompt $" { fail "print signed short == (minus)" } | |
619 | timeout { fail "(timeout) print signed short == (minus)" } | |
620 | } | |
621 | } | |
622 | -re "$prompt $" { fail "print signed short == (minus)" } | |
623 | timeout { fail "(timeout) print signed short == (minus)" } | |
624 | } | |
625 | } | |
626 | -re "$prompt $" { fail "print signed short == (minus)" } | |
627 | timeout { fail "(timeout) print signed short == (minus)" } | |
628 | } | |
629 | ||
630 | ||
631 | send "set variable v_short=-1\n" | |
632 | expect { | |
633 | -re "set.*$prompt $" { | |
634 | send "print v_short != 0\n" | |
635 | expect { | |
636 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
637 | send "print v_short != -1\n" | |
638 | expect { | |
639 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed short != (minus)" } | |
640 | -re "$prompt $" { fail "print signed short != (minus)" } | |
641 | timeout { fail "(timeout) print signed short != (minus)" } | |
642 | } | |
643 | } | |
644 | -re "$prompt $" { fail "print signed short != (minus)" } | |
645 | timeout { fail "(timeout) print signed short != (minus)" } | |
646 | } | |
647 | } | |
648 | -re "$prompt $" { fail "print signed short != (minus)" } | |
649 | timeout { fail "(timeout) print signed short != (minus)" } | |
650 | } | |
651 | ||
652 | ||
653 | send "set variable v_short=-1\n" | |
654 | expect { | |
655 | -re "set.*$prompt $" { | |
656 | send "print v_short < 0\n" | |
657 | expect { | |
658 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
659 | send "print v_short < 0x7FFF\n" | |
660 | expect { | |
661 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print signed short < (minus)" } | |
662 | -re "$prompt $" { fail "print signed short < (minus)" } | |
663 | timeout { fail "(timeout) print signed short < (minus)" } | |
664 | } | |
665 | } | |
666 | -re "$prompt $" { fail "print signed short < (minus)" } | |
667 | timeout { fail "(timeout) print signed short < (minus)" } | |
668 | } | |
669 | } | |
670 | -re "$prompt $" { fail "print signed short < (minus)" } | |
671 | timeout { fail "(timeout) print signed short < (minus)" } | |
672 | } | |
673 | ||
674 | ||
675 | send "set variable v_short=-1\n" | |
676 | expect { | |
677 | -re "set.*$prompt $" { | |
678 | send "print v_short > 0\n" | |
679 | expect { | |
680 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
681 | send "print v_short > 0x7FFF\n" | |
682 | expect { | |
683 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed short > (minus)" } | |
684 | -re "$prompt $" { fail "print signed short > (minus)" } | |
685 | timeout { fail "(timeout) print signed short > (minus)" } | |
686 | } | |
687 | } | |
688 | -re "$prompt $" { fail "print signed short > (minus)" } | |
689 | timeout { fail "(timeout) print signed short > (minus)" } | |
690 | } | |
691 | } | |
692 | -re "$prompt $" { fail "print signed short > (minus)" } | |
693 | timeout { fail "(timeout) print signed short > (minus)" } | |
694 | } | |
695 | ||
696 | ||
697 | # | |
698 | # test expressions with "signed short" types | |
699 | # | |
700 | send "set variable v_signed_short=0x7FFF\n" | |
701 | expect { | |
702 | -re "set.*$prompt $" { | |
703 | send "print v_signed_short == 0\n" | |
704 | expect { | |
705 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
706 | send "print v_signed_short == 0x7FFF\n" | |
707 | expect { | |
708 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print signed signed short ==" } | |
709 | -re "$prompt $" { fail "print signed signed short ==" } | |
710 | timeout { fail "(timeout) print signed signed short ==" } | |
711 | } | |
712 | } | |
713 | -re "$prompt $" { fail "print signed signed short ==" } | |
714 | timeout { fail "(timeout) print signed signed short ==" } | |
715 | } | |
716 | } | |
717 | -re "$prompt $" { fail "print signed signed short ==" } | |
718 | timeout { fail "(timeout) print signed signed short ==" } | |
719 | } | |
720 | ||
721 | ||
722 | send "set variable v_signed_short=0x7FFF\n" | |
723 | expect { | |
724 | -re "set.*$prompt $" { | |
725 | send "print v_signed_short != 0\n" | |
726 | expect { | |
727 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
728 | send "print v_signed_short != 0x7FFF\n" | |
729 | expect { | |
730 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed signed short !=" } | |
731 | -re "$prompt $" { fail "print signed signed short !=" } | |
732 | timeout { fail "(timeout) print signed signed short !=" } | |
733 | } | |
734 | } | |
735 | -re "$prompt $" { fail "print signed signed short !=" } | |
736 | timeout { fail "(timeout) print signed signed short !=" } | |
737 | } | |
738 | } | |
739 | -re "$prompt $" { fail "print signed signed short !=" } | |
740 | timeout { fail "(timeout) print signed signed short !=" } | |
741 | } | |
742 | ||
743 | ||
744 | send "set variable v_signed_short=0x7FFF\n" | |
745 | expect { | |
746 | -re "set.*$prompt $" { | |
747 | send "print v_signed_short < 0\n" | |
748 | expect { | |
749 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
750 | send "print v_signed_short < 0x7FFF\n" | |
751 | expect { | |
752 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed signed short <" } | |
753 | -re "$prompt $" { fail "print signed signed short <" } | |
754 | timeout { fail "(timeout) print signed signed short <" } | |
755 | } | |
756 | } | |
757 | -re "$prompt $" { fail "print signed signed short <" } | |
758 | timeout { fail "(timeout) print signed signed short <" } | |
759 | } | |
760 | } | |
761 | -re "$prompt $" { fail "print signed signed short <" } | |
762 | timeout { fail "(timeout) print signed signed short <" } | |
763 | } | |
764 | ||
765 | ||
766 | send "set variable v_signed_short=0x7FFF\n" | |
767 | expect { | |
768 | -re "set.*$prompt $" { | |
769 | send "print v_signed_short > 0\n" | |
770 | expect { | |
771 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
772 | send "print v_signed_short > 0x7FFF\n" | |
773 | expect { | |
774 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed signed short >" } | |
775 | -re "$prompt $" { fail "print signed signed short >" } | |
776 | timeout { fail "(timeout) print signed signed short >" } | |
777 | } | |
778 | } | |
779 | -re "$prompt $" { fail "print signed signed short >" } | |
780 | timeout { fail "(timeout) print signed signed short >" } | |
781 | } | |
782 | } | |
783 | -re "$prompt $" { fail "print signed signed short >" } | |
784 | timeout { fail "(timeout) print signed signed short >" } | |
785 | } | |
786 | ||
787 | ||
788 | # make short a minus | |
789 | send "set variable v_signed_short=-1\n" | |
790 | expect { | |
791 | -re "set.*$prompt $" { | |
792 | send "print v_signed_short == 0\n" | |
793 | expect { | |
794 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
795 | send "print v_signed_short == -1\n" | |
796 | expect { | |
797 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print signed signed short == (minus)" } | |
798 | -re "$prompt $" { fail "print signed signed short == (minus)" } | |
799 | timeout { fail "(timeout) print signed signed short == (minus)" } | |
800 | } | |
801 | } | |
802 | -re "$prompt $" { fail "print signed signed short == (minus)" } | |
803 | timeout { fail "(timeout) print signed signed short == (minus)" } | |
804 | } | |
805 | } | |
806 | -re "$prompt $" { fail "print signed signed short == (minus)" } | |
807 | timeout { fail "(timeout) print signed signed short == (minus)" } | |
808 | } | |
809 | ||
810 | ||
811 | send "set variable v_signed_short=-1\n" | |
812 | expect { | |
813 | -re "set.*$prompt $" { | |
814 | send "print v_signed_short != 0\n" | |
815 | expect { | |
816 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
817 | send "print v_signed_short != -1\n" | |
818 | expect { | |
819 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed signed short != (minus)" } | |
820 | -re "$prompt $" { fail "print signed signed short != (minus)" } | |
821 | timeout { fail "(timeout) print signed signed short != (minus)" } | |
822 | } | |
823 | } | |
824 | -re "$prompt $" { fail "print signed signed short != (minus)" } | |
825 | timeout { fail "(timeout) print signed signed short != (minus)" } | |
826 | } | |
827 | } | |
828 | -re "$prompt $" { fail "print signed signed short != (minus)" } | |
829 | timeout { fail "(timeout) print signed signed short != (minus)" } | |
830 | } | |
831 | ||
832 | ||
833 | send "set variable v_signed_short=-1\n" | |
834 | expect { | |
835 | -re "set.*$prompt $" { | |
836 | send "print v_signed_short < 0\n" | |
837 | expect { | |
838 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
839 | send "print v_signed_short < 0x7FFF\n" | |
840 | expect { | |
841 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print signed signed short < (minus)" } | |
842 | -re "$prompt $" { fail "print signed signed short < (minus)" } | |
843 | timeout { fail "(timeout) print signed signed short < (minus)" } | |
844 | } | |
845 | } | |
846 | -re "$prompt $" { fail "print signed signed short < (minus)" } | |
847 | timeout { fail "(timeout) print signed signed short < (minus)" } | |
848 | } | |
849 | } | |
850 | -re "$prompt $" { fail "print signed signed short < (minus)" } | |
851 | timeout { fail "(timeout) print signed signed short < (minus)" } | |
852 | } | |
853 | ||
854 | ||
855 | send "set variable v_signed_short=-1\n" | |
856 | expect { | |
857 | -re "set.*$prompt $" { | |
858 | send "print v_signed_short > 0\n" | |
859 | expect { | |
860 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
861 | send "print v_signed_short > 0x7FFF\n" | |
862 | expect { | |
863 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed signed short > (minus)" } | |
864 | -re "$prompt $" { fail "print signed signed short > (minus)" } | |
865 | timeout { fail "(timeout) print signed signed short > (minus)" } | |
866 | } | |
867 | } | |
868 | -re "$prompt $" { fail "print signed signed short > (minus)" } | |
869 | timeout { fail "(timeout) print signed signed short > (minus)" } | |
870 | } | |
871 | } | |
872 | -re "$prompt $" { fail "print signed signed short > (minus)" } | |
873 | timeout { fail "(timeout) print signed signed short > (minus)" } | |
874 | } | |
875 | ||
876 | ||
877 | # | |
878 | # test expressions with "unsigned short" types | |
879 | # | |
880 | send "set variable v_unsigned_short=0x7FFF\n" | |
881 | expect { | |
882 | -re "set.*$prompt $" { | |
883 | send "print v_unsigned_short == 0\n" | |
884 | expect { | |
885 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
886 | send "print v_unsigned_short == 0x7FFF\n" | |
887 | expect { | |
888 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print unsigned short ==" } | |
889 | -re "$prompt $" { fail "print unsigned short ==" } | |
890 | timeout { fail "(timeout) print unsigned short ==" } | |
891 | } | |
892 | } | |
893 | -re "$prompt $" { fail "print unsigned short ==" } | |
894 | timeout { fail "(timeout) print unsigned short ==" } | |
895 | } | |
896 | } | |
897 | -re "$prompt $" { fail "print unsigned short ==" } | |
898 | timeout { fail "(timeout) print unsigned short ==" } | |
899 | } | |
900 | ||
901 | ||
902 | send "set variable v_unsigned_short=0x7FFF\n" | |
903 | expect { | |
904 | -re "set.*$prompt $" { | |
905 | send "print v_unsigned_short != 0\n" | |
906 | expect { | |
907 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
908 | send "print v_unsigned_short != 0x7FFF\n" | |
909 | expect { | |
910 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print unsigned short !=" } | |
911 | -re "$prompt $" { fail "print unsigned short !=" } | |
912 | timeout { fail "(timeout) print unsigned short !=" } | |
913 | } | |
914 | } | |
915 | -re "$prompt $" { fail "print unsigned short !=" } | |
916 | timeout { fail "(timeout) print unsigned short !=" } | |
917 | } | |
918 | } | |
919 | -re "$prompt $" { fail "print unsigned short !=" } | |
920 | timeout { fail "(timeout) print unsigned short !=" } | |
921 | } | |
922 | ||
923 | ||
924 | send "set variable v_unsigned_short=0x7FFF\n" | |
925 | expect { | |
926 | -re "set.*$prompt $" { | |
927 | send "print v_unsigned_short < 0\n" | |
928 | expect { | |
929 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
930 | send "print v_unsigned_short < 0x7FFF\n" | |
931 | expect { | |
932 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print unsigned short <" } | |
933 | -re "$prompt $" { fail "print unsigned short <" } | |
934 | timeout { fail "(timeout) print unsigned short <" } | |
935 | } | |
936 | } | |
937 | -re "$prompt $" { fail "print unsigned short <" } | |
938 | timeout { fail "(timeout) print unsigned short <" } | |
939 | } | |
940 | } | |
941 | -re "$prompt $" { fail "print unsigned short <" } | |
942 | timeout { fail "(timeout) print unsigned short <" } | |
943 | } | |
944 | ||
945 | ||
946 | send "set variable v_unsigned_short=0x7FFF\n" | |
947 | expect { | |
948 | -re "set.*$prompt $" { | |
949 | send "print v_unsigned_short > 0\n" | |
950 | expect { | |
951 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
952 | send "print v_unsigned_short > 0x7FFF\n" | |
953 | expect { | |
954 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print unsigned short >" } | |
955 | -re "$prompt $" { fail "print unsigned short >" } | |
956 | timeout { fail "(timeout) print unsigned short >" } | |
957 | } | |
958 | } | |
959 | -re "$prompt $" { fail "print unsigned short >" } | |
960 | timeout { fail "(timeout) print unsigned short >" } | |
961 | } | |
962 | } | |
963 | -re "$prompt $" { fail "print unsigned short >" } | |
964 | timeout { fail "(timeout) print unsigned short >" } | |
965 | } | |
966 | ||
967 | ||
968 | # make short a minus | |
969 | send "set variable v_unsigned_short=~0\n" | |
970 | expect { | |
971 | -re "set.*$prompt $" { | |
972 | send "print v_unsigned_short == 0\n" | |
973 | expect { | |
974 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
975 | send "print v_unsigned_short == ~0\n" | |
976 | expect { | |
977 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
978 | send "print v_unsigned_short == (unsigned short)~0\n" | |
979 | expect { | |
980 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print unsigned short == (~0)" } | |
981 | -re "$prompt $" { fail "print unsigned short == (~0)" } | |
982 | timeout { fail "(timeout) print unsigned short == (~0)" } | |
983 | } | |
984 | } | |
985 | -re "$prompt $" { fail "print unsigned short == (~0)" } | |
986 | timeout { fail "(timeout) print unsigned short == (~0)" } | |
987 | } | |
988 | } | |
989 | -re "$prompt $" { fail "print unsigned short == (~0)" } | |
990 | timeout { fail "(timeout) print unsigned short == (~0)" } | |
991 | } | |
992 | } | |
993 | -re "$prompt $" { fail "print unsigned short == (~0)" } | |
994 | timeout { fail "(timeout) print unsigned short == (~0)" } | |
995 | } | |
996 | ||
997 | ||
998 | send "set variable v_unsigned_short=~0\n" | |
999 | expect { | |
1000 | -re "set.*$prompt $" { | |
1001 | send "print v_unsigned_short != 0\n" | |
1002 | expect { | |
1003 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1004 | send "print v_unsigned_short != (unsigned short)~0\n" | |
1005 | expect { | |
1006 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print unsigned short != (~0)" } | |
1007 | -re "$prompt $" { fail "print unsigned short != (~0)" } | |
1008 | timeout { fail "(timeout) print unsigned short != (~0)" } | |
1009 | } | |
1010 | } | |
1011 | -re "$prompt $" { fail "print unsigned short != (~0)" } | |
1012 | timeout { fail "(timeout) print unsigned short != (~0)" } | |
1013 | } | |
1014 | } | |
1015 | -re "$prompt $" { fail "print unsigned short != (~0)" } | |
1016 | timeout { fail "(timeout) print unsigned short != (~0)" } | |
1017 | } | |
1018 | ||
1019 | ||
1020 | send "set variable v_unsigned_short=~0\n" | |
1021 | expect { | |
1022 | -re "set.*$prompt $" { | |
1023 | send "print v_unsigned_short < 0\n" | |
1024 | expect { | |
1025 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1026 | send "print v_unsigned_short < 0x7FFF\n" | |
1027 | expect { | |
1028 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print unsigned short < (~0)" } | |
1029 | -re "$prompt $" { fail "print unsigned short < (~0)" } | |
1030 | timeout { fail "(timeout) print unsigned short < (~0)" } | |
1031 | } | |
1032 | } | |
1033 | -re "$prompt $" { fail "print unsigned short < (~0)" } | |
1034 | timeout { fail "(timeout) print unsigned short < (~0)" } | |
1035 | } | |
1036 | } | |
1037 | -re "$prompt $" { fail "print unsigned short < (~0)" } | |
1038 | timeout { fail "(timeout) print unsigned short < (~0)" } | |
1039 | } | |
1040 | ||
1041 | ||
1042 | send "set variable v_unsigned_short=~0\n" | |
1043 | expect { | |
1044 | -re "set.*$prompt $" { | |
1045 | send "print v_unsigned_short > 0\n" | |
1046 | expect { | |
1047 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1048 | send "print v_unsigned_short > 0x7FFF\n" | |
1049 | expect { | |
1050 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print unsigned short > (~0)" } | |
1051 | -re "$prompt $" { fail "print unsigned short > (~0)" } | |
1052 | timeout { fail "(timeout) print unsigned short > (~0)" } | |
1053 | } | |
1054 | } | |
1055 | -re "$prompt $" { fail "print unsigned short > (~0)" } | |
1056 | timeout { fail "(timeout) print unsigned short > (~0)" } | |
1057 | } | |
1058 | } | |
1059 | -re "$prompt $" { fail "print unsigned short > (~0)" } | |
1060 | timeout { fail "(timeout) print unsigned short > (~0)" } | |
1061 | } | |
1062 | ||
1063 | ||
1064 | # | |
1065 | # test expressions with "int" types | |
1066 | # | |
1067 | send "set variable v_int=0x7FFF\n" | |
1068 | expect { | |
1069 | -re "set.*$prompt $" { | |
1070 | send "print v_int == 0\n" | |
1071 | expect { | |
1072 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1073 | send "print v_int == 0x7FFF\n" | |
1074 | expect { | |
1075 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print signed int ==" } | |
1076 | -re "$prompt $" { fail "print signed int ==" } | |
1077 | timeout { fail "(timeout) print signed int ==" } | |
1078 | } | |
1079 | } | |
1080 | -re "$prompt $" { fail "print signed int ==" } | |
1081 | timeout { fail "(timeout) print signed int ==" } | |
1082 | } | |
1083 | } | |
1084 | -re "$prompt $" { fail "print signed int ==" } | |
1085 | timeout { fail "(timeout) print signed int ==" } | |
1086 | } | |
1087 | ||
1088 | ||
1089 | send "set variable v_int=0x7FFF\n" | |
1090 | expect { | |
1091 | -re "set.*$prompt $" { | |
1092 | send "print v_int != 0\n" | |
1093 | expect { | |
1094 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1095 | send "print v_int != 0x7FFF\n" | |
1096 | expect { | |
1097 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed int !=" } | |
1098 | -re "$prompt $" { fail "print signed int !=" } | |
1099 | timeout { fail "(timeout) print signed int !=" } | |
1100 | } | |
1101 | } | |
1102 | -re "$prompt $" { fail "print signed int !=" } | |
1103 | timeout { fail "(timeout) print signed int !=" } | |
1104 | } | |
1105 | } | |
1106 | -re "$prompt $" { fail "print signed int !=" } | |
1107 | timeout { fail "(timeout) print signed int !=" } | |
1108 | } | |
1109 | ||
1110 | ||
1111 | send "set variable v_int=0x7FFF\n" | |
1112 | expect { | |
1113 | -re "set.*$prompt $" { | |
1114 | send "print v_int < 0\n" | |
1115 | expect { | |
1116 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1117 | send "print v_int < 0x7FFF\n" | |
1118 | expect { | |
1119 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed int <" } | |
1120 | -re "$prompt $" { fail "print signed int <" } | |
1121 | timeout { fail "(timeout) print signed int <" } | |
1122 | } | |
1123 | } | |
1124 | -re "$prompt $" { fail "print signed int <" } | |
1125 | timeout { fail "(timeout) print signed int <" } | |
1126 | } | |
1127 | } | |
1128 | -re "$prompt $" { fail "print signed int <" } | |
1129 | timeout { fail "(timeout) print signed int <" } | |
1130 | } | |
1131 | ||
1132 | ||
1133 | send "set variable v_int=0x7FFF\n" | |
1134 | expect { | |
1135 | -re "set.*$prompt $" { | |
1136 | send "print v_int > 0\n" | |
1137 | expect { | |
1138 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1139 | send "print v_int > 0x7FFF\n" | |
1140 | expect { | |
1141 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed int >" } | |
1142 | -re "$prompt $" { fail "print signed int >" } | |
1143 | timeout { fail "(timeout) print signed int >" } | |
1144 | } | |
1145 | } | |
1146 | -re "$prompt $" { fail "print signed int >" } | |
1147 | timeout { fail "(timeout) print signed int >" } | |
1148 | } | |
1149 | } | |
1150 | -re "$prompt $" { fail "print signed int >" } | |
1151 | timeout { fail "(timeout) print signed int >" } | |
1152 | } | |
1153 | ||
1154 | ||
1155 | # make int a minus | |
1156 | send "set variable v_int=-1\n" | |
1157 | expect { | |
1158 | -re "set.*$prompt $" { | |
1159 | send "print v_int == 0\n" | |
1160 | expect { | |
1161 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1162 | send "print v_int == -1\n" | |
1163 | expect { | |
1164 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print signed int == (minus)" } | |
1165 | -re "$prompt $" { fail "print signed int == (minus)" } | |
1166 | timeout { fail "(timeout) print signed int == (minus)" } | |
1167 | } | |
1168 | } | |
1169 | -re "$prompt $" { fail "print signed int == (minus)" } | |
1170 | timeout { fail "(timeout) print signed int == (minus)" } | |
1171 | } | |
1172 | } | |
1173 | -re "$prompt $" { fail "print signed int == (minus)" } | |
1174 | timeout { fail "(timeout) print signed int == (minus)" } | |
1175 | } | |
1176 | ||
1177 | ||
1178 | send "set variable v_int=-1\n" | |
1179 | expect { | |
1180 | -re "set.*$prompt $" { | |
1181 | send "print v_int != 0\n" | |
1182 | expect { | |
1183 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1184 | send "print v_int != -1\n" | |
1185 | expect { | |
1186 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed int != (minus)" } | |
1187 | -re "$prompt $" { fail "print signed int != (minus)" } | |
1188 | timeout { fail "(timeout) print signed int != (minus)" } | |
1189 | } | |
1190 | } | |
1191 | -re "$prompt $" { fail "print signed int != (minus)" } | |
1192 | timeout { fail "(timeout) print signed int != (minus)" } | |
1193 | } | |
1194 | } | |
1195 | -re "$prompt $" { fail "print signed int != (minus)" } | |
1196 | timeout { fail "(timeout) print signed int != (minus)" } | |
1197 | } | |
1198 | ||
1199 | ||
1200 | send "set variable v_int=-1\n" | |
1201 | expect { | |
1202 | -re "set.*$prompt $" { | |
1203 | send "print v_int < 0\n" | |
1204 | expect { | |
1205 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1206 | send "print v_int < 0x7FFF\n" | |
1207 | expect { | |
1208 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print signed int < (minus)" } | |
1209 | -re "$prompt $" { fail "print signed int < (minus)" } | |
1210 | timeout { fail "(timeout) print signed int < (minus)" } | |
1211 | } | |
1212 | } | |
1213 | -re "$prompt $" { fail "print signed int < (minus)" } | |
1214 | timeout { fail "(timeout) print signed int < (minus)" } | |
1215 | } | |
1216 | } | |
1217 | -re "$prompt $" { fail "print signed int < (minus)" } | |
1218 | timeout { fail "(timeout) print signed int < (minus)" } | |
1219 | } | |
1220 | ||
1221 | ||
1222 | send "set variable v_int=-1\n" | |
1223 | expect { | |
1224 | -re "set.*$prompt $" { | |
1225 | send "print v_int > 0\n" | |
1226 | expect { | |
1227 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1228 | send "print v_int > 0x7FFF\n" | |
1229 | expect { | |
1230 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed int > (minus)" } | |
1231 | -re "$prompt $" { fail "print signed int > (minus)" } | |
1232 | timeout { fail "(timeout) print signed int > (minus)" } | |
1233 | } | |
1234 | } | |
1235 | -re "$prompt $" { fail "print signed int > (minus)" } | |
1236 | timeout { fail "(timeout) print signed int > (minus)" } | |
1237 | } | |
1238 | } | |
1239 | -re "$prompt $" { fail "print signed int > (minus)" } | |
1240 | timeout { fail "(timeout) print signed int > (minus)" } | |
1241 | } | |
1242 | ||
1243 | ||
1244 | # | |
1245 | # test expressions with "signed int" types | |
1246 | # | |
1247 | send "set variable v_signed_int=0x7FFF\n" | |
1248 | expect { | |
1249 | -re "set.*$prompt $" { | |
1250 | send "print v_signed_int == 0\n" | |
1251 | expect { | |
1252 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1253 | send "print v_signed_int == 0x7FFF\n" | |
1254 | expect { | |
1255 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print signed signed int ==" } | |
1256 | -re "$prompt $" { fail "print signed signed int ==" } | |
1257 | timeout { fail "(timeout) print signed signed int ==" } | |
1258 | } | |
1259 | } | |
1260 | -re "$prompt $" { fail "print signed signed int ==" } | |
1261 | timeout { fail "(timeout) print signed signed int ==" } | |
1262 | } | |
1263 | } | |
1264 | -re "$prompt $" { fail "print signed signed int ==" } | |
1265 | timeout { fail "(timeout) print signed signed int ==" } | |
1266 | } | |
1267 | ||
1268 | ||
1269 | send "set variable v_signed_int=0x7FFF\n" | |
1270 | expect { | |
1271 | -re "set.*$prompt $" { | |
1272 | send "print v_signed_int != 0\n" | |
1273 | expect { | |
1274 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1275 | send "print v_signed_int != 0x7FFF\n" | |
1276 | expect { | |
1277 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed signed int !=" } | |
1278 | -re "$prompt $" { fail "print signed signed int !=" } | |
1279 | timeout { fail "(timeout) print signed signed int !=" } | |
1280 | } | |
1281 | } | |
1282 | -re "$prompt $" { fail "print signed signed int !=" } | |
1283 | timeout { fail "(timeout) print signed signed int !=" } | |
1284 | } | |
1285 | } | |
1286 | -re "$prompt $" { fail "print signed signed int !=" } | |
1287 | timeout { fail "(timeout) print signed signed int !=" } | |
1288 | } | |
1289 | ||
1290 | ||
1291 | send "set variable v_signed_int=0x7FFF\n" | |
1292 | expect { | |
1293 | -re "set.*$prompt $" { | |
1294 | send "print v_signed_int < 0\n" | |
1295 | expect { | |
1296 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1297 | send "print v_signed_int < 0x7FFF\n" | |
1298 | expect { | |
1299 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed signed int <" } | |
1300 | -re "$prompt $" { fail "print signed signed int <" } | |
1301 | timeout { fail "(timeout) print signed signed int <" } | |
1302 | } | |
1303 | } | |
1304 | -re "$prompt $" { fail "print signed signed int <" } | |
1305 | timeout { fail "(timeout) print signed signed int <" } | |
1306 | } | |
1307 | } | |
1308 | -re "$prompt $" { fail "print signed signed int <" } | |
1309 | timeout { fail "(timeout) print signed signed int <" } | |
1310 | } | |
1311 | ||
1312 | ||
1313 | send "set variable v_signed_int=0x7FFF\n" | |
1314 | expect { | |
1315 | -re "set.*$prompt $" { | |
1316 | send "print v_signed_int > 0\n" | |
1317 | expect { | |
1318 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1319 | send "print v_signed_int > 0x7FFF\n" | |
1320 | expect { | |
1321 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed signed int >" } | |
1322 | -re "$prompt $" { fail "print signed signed int >" } | |
1323 | timeout { fail "(timeout) print signed signed int >" } | |
1324 | } | |
1325 | } | |
1326 | -re "$prompt $" { fail "print signed signed int >" } | |
1327 | timeout { fail "(timeout) print signed signed int >" } | |
1328 | } | |
1329 | } | |
1330 | -re "$prompt $" { fail "print signed signed int >" } | |
1331 | timeout { fail "(timeout) print signed signed int >" } | |
1332 | } | |
1333 | ||
1334 | ||
1335 | # make int a minus | |
1336 | send "set variable v_signed_int=-1\n" | |
1337 | expect { | |
1338 | -re "set.*$prompt $" { | |
1339 | send "print v_signed_int == 0\n" | |
1340 | expect { | |
1341 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1342 | send "print v_signed_int == -1\n" | |
1343 | expect { | |
1344 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print signed signed int == (minus)" } | |
1345 | -re "$prompt $" { fail "print signed signed int == (minus)" } | |
1346 | timeout { fail "(timeout) print signed signed int == (minus)" } | |
1347 | } | |
1348 | } | |
1349 | -re "$prompt $" { fail "print signed signed int == (minus)" } | |
1350 | timeout { fail "(timeout) print signed signed int == (minus)" } | |
1351 | } | |
1352 | } | |
1353 | -re "$prompt $" { fail "print signed signed int == (minus)" } | |
1354 | timeout { fail "(timeout) print signed signed int == (minus)" } | |
1355 | } | |
1356 | ||
1357 | ||
1358 | send "set variable v_signed_int=-1\n" | |
1359 | expect { | |
1360 | -re "set.*$prompt $" { | |
1361 | send "print v_signed_int != 0\n" | |
1362 | expect { | |
1363 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1364 | send "print v_signed_int != -1\n" | |
1365 | expect { | |
1366 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed signed int != (minus)" } | |
1367 | -re "$prompt $" { fail "print signed signed int != (minus)" } | |
1368 | timeout { fail "(timeout) print signed signed int != (minus)" } | |
1369 | } | |
1370 | } | |
1371 | -re "$prompt $" { fail "print signed signed int != (minus)" } | |
1372 | timeout { fail "(timeout) print signed signed int != (minus)" } | |
1373 | } | |
1374 | } | |
1375 | -re "$prompt $" { fail "print signed signed int != (minus)" } | |
1376 | timeout { fail "(timeout) print signed signed int != (minus)" } | |
1377 | } | |
1378 | ||
1379 | ||
1380 | send "set variable v_signed_int=-1\n" | |
1381 | expect { | |
1382 | -re "set.*$prompt $" { | |
1383 | send "print v_signed_int < 0\n" | |
1384 | expect { | |
1385 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1386 | send "print v_signed_int < 0x7FFF\n" | |
1387 | expect { | |
1388 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print signed signed int < (minus)" } | |
1389 | -re "$prompt $" { fail "print signed signed int < (minus)" } | |
1390 | timeout { fail "(timeout) print signed signed int < (minus)" } | |
1391 | } | |
1392 | } | |
1393 | -re "$prompt $" { fail "print signed signed int < (minus)" } | |
1394 | timeout { fail "(timeout) print signed signed int < (minus)" } | |
1395 | } | |
1396 | } | |
1397 | -re "$prompt $" { fail "print signed signed int < (minus)" } | |
1398 | timeout { fail "(timeout) print signed signed int < (minus)" } | |
1399 | } | |
1400 | ||
1401 | ||
1402 | send "set variable v_signed_int=-1\n" | |
1403 | expect { | |
1404 | -re "set.*$prompt $" { | |
1405 | send "print v_signed_int > 0\n" | |
1406 | expect { | |
1407 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1408 | send "print v_signed_int > 0x7FFF\n" | |
1409 | expect { | |
1410 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed signed int > (minus)" } | |
1411 | -re "$prompt $" { fail "print signed signed int > (minus)" } | |
1412 | timeout { fail "(timeout) print signed signed int > (minus)" } | |
1413 | } | |
1414 | } | |
1415 | -re "$prompt $" { fail "print signed signed int > (minus)" } | |
1416 | timeout { fail "(timeout) print signed signed int > (minus)" } | |
1417 | } | |
1418 | } | |
1419 | -re "$prompt $" { fail "print signed signed int > (minus)" } | |
1420 | timeout { fail "(timeout) print signed signed int > (minus)" } | |
1421 | } | |
1422 | ||
1423 | ||
1424 | # | |
1425 | # test expressions with "unsigned int" types | |
1426 | # | |
1427 | send "set variable v_unsigned_int=0x7FFF\n" | |
1428 | expect { | |
1429 | -re "set.*$prompt $" { | |
1430 | send "print v_unsigned_int == 0\n" | |
1431 | expect { | |
1432 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1433 | send "print v_unsigned_int == 0x7FFF\n" | |
1434 | expect { | |
1435 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print unsigned int ==" } | |
1436 | -re "$prompt $" { fail "print unsigned int ==" } | |
1437 | timeout { fail "(timeout) print unsigned int ==" } | |
1438 | } | |
1439 | } | |
1440 | -re "$prompt $" { fail "print unsigned int ==" } | |
1441 | timeout { fail "(timeout) print unsigned int ==" } | |
1442 | } | |
1443 | } | |
1444 | -re "$prompt $" { fail "print unsigned int ==" } | |
1445 | timeout { fail "(timeout) print unsigned int ==" } | |
1446 | } | |
1447 | ||
1448 | ||
1449 | send "set variable v_unsigned_int=0x7FFF\n" | |
1450 | expect { | |
1451 | -re "set.*$prompt $" { | |
1452 | send "print v_unsigned_int != 0\n" | |
1453 | expect { | |
1454 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1455 | send "print v_unsigned_int != 0x7FFF\n" | |
1456 | expect { | |
1457 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print unsigned int !=" } | |
1458 | -re "$prompt $" { fail "print unsigned int !=" } | |
1459 | timeout { fail "(timeout) print unsigned int !=" } | |
1460 | } | |
1461 | } | |
1462 | -re "$prompt $" { fail "print unsigned int !=" } | |
1463 | timeout { fail "(timeout) print unsigned int !=" } | |
1464 | } | |
1465 | } | |
1466 | -re "$prompt $" { fail "print unsigned int !=" } | |
1467 | timeout { fail "(timeout) print unsigned int !=" } | |
1468 | } | |
1469 | ||
1470 | ||
1471 | send "set variable v_unsigned_int=0x7FFF\n" | |
1472 | expect { | |
1473 | -re "set.*$prompt $" { | |
1474 | send "print v_unsigned_int < 0\n" | |
1475 | expect { | |
1476 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1477 | send "print v_unsigned_int < 0x7FFF\n" | |
1478 | expect { | |
1479 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print unsigned int <" } | |
1480 | -re "$prompt $" { fail "print unsigned int <" } | |
1481 | timeout { fail "(timeout) print unsigned int <" } | |
1482 | } | |
1483 | } | |
1484 | -re "$prompt $" { fail "print unsigned int <" } | |
1485 | timeout { fail "(timeout) print unsigned int <" } | |
1486 | } | |
1487 | } | |
1488 | -re "$prompt $" { fail "print unsigned int <" } | |
1489 | timeout { fail "(timeout) print unsigned int <" } | |
1490 | } | |
1491 | ||
1492 | ||
1493 | send "set variable v_unsigned_int=0x7FFF\n" | |
1494 | expect { | |
1495 | -re "set.*$prompt $" { | |
1496 | send "print v_unsigned_int > 0\n" | |
1497 | expect { | |
1498 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1499 | send "print v_unsigned_int > 0x7FFF\n" | |
1500 | expect { | |
1501 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print unsigned int >" } | |
1502 | -re "$prompt $" { fail "print unsigned int >" } | |
1503 | timeout { fail "(timeout) print unsigned int >" } | |
1504 | } | |
1505 | } | |
1506 | -re "$prompt $" { fail "print unsigned int >" } | |
1507 | timeout { fail "(timeout) print unsigned int >" } | |
1508 | } | |
1509 | } | |
1510 | -re "$prompt $" { fail "print unsigned int >" } | |
1511 | timeout { fail "(timeout) print unsigned int >" } | |
1512 | } | |
1513 | ||
1514 | ||
1515 | # make int a minus | |
1516 | send "set variable v_unsigned_int=~0\n" | |
1517 | expect { | |
1518 | -re "set.*$prompt $" { | |
1519 | send "print v_unsigned_int == 0\n" | |
1520 | expect { | |
1521 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1522 | send "print v_unsigned_int == ~0\n" | |
1523 | expect { | |
1524 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1525 | send "print v_unsigned_int == (unsigned int)~0\n" | |
1526 | expect { | |
1527 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print unsigned int == (~0)" } | |
1528 | -re "$prompt $" { fail "print unsigned int == (~0)" } | |
1529 | timeout { fail "(timeout) print unsigned int == (~0)" } | |
1530 | } | |
1531 | } | |
1532 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1533 | # gdb currently compares all values as long, so this failure probably | |
1534 | # applies to any configuration where LONGEST is bigger than a target int. | |
1535 | setup_xfail "alpha-*-*" | |
1536 | fail "print unsigned int == (~0)" | |
1537 | send "print v_unsigned_int == (unsigned int)~0\n" | |
1538 | expect { | |
1539 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print unsigned int == (~0)" } | |
1540 | -re "$prompt $" { fail "print unsigned int == (~0)" } | |
1541 | timeout { fail "(timeout) print unsigned int == (~0)" } | |
1542 | } | |
1543 | } | |
1544 | -re "$prompt $" { fail "print unsigned int == (~0)" } | |
1545 | timeout { fail "(timeout) print unsigned int == (~0)" } | |
1546 | } | |
1547 | } | |
1548 | -re "$prompt $" { fail "print unsigned int == (~0)" } | |
1549 | timeout { fail "(timeout) print unsigned int == (~0)" } | |
1550 | } | |
1551 | } | |
1552 | -re "$prompt $" { fail "print unsigned int == (~0)" } | |
1553 | timeout { fail "(timeout) print unsigned int == (~0)" } | |
1554 | } | |
1555 | ||
1556 | ||
1557 | send "set variable v_unsigned_int=~0\n" | |
1558 | expect { | |
1559 | -re "set.*$prompt $" { | |
1560 | send "print v_unsigned_int != 0\n" | |
1561 | expect { | |
1562 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1563 | send "print v_unsigned_int != (unsigned int)~0\n" | |
1564 | expect { | |
1565 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print unsigned int != (~0)" } | |
1566 | -re "$prompt $" { fail "print unsigned int != (~0)" } | |
1567 | timeout { fail "(timeout) print unsigned int != (~0)" } | |
1568 | } | |
1569 | } | |
1570 | -re "$prompt $" { fail "print unsigned int != (~0)" } | |
1571 | timeout { fail "(timeout) print unsigned int != (~0)" } | |
1572 | } | |
1573 | } | |
1574 | -re "$prompt $" { fail "print unsigned int != (~0)" } | |
1575 | timeout { fail "(timeout) print unsigned int != (~0)" } | |
1576 | } | |
1577 | ||
1578 | ||
1579 | send "set variable v_unsigned_int=~0\n" | |
1580 | expect { | |
1581 | -re "set.*$prompt $" { | |
1582 | send "print v_unsigned_int < 0\n" | |
1583 | expect { | |
1584 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1585 | send "print v_unsigned_int < 0x7FFF\n" | |
1586 | expect { | |
1587 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print unsigned int < (~0)" } | |
1588 | -re "$prompt $" { fail "print unsigned int < (~0)" } | |
1589 | timeout { fail "(timeout) print unsigned int < (~0)" } | |
1590 | } | |
1591 | } | |
1592 | -re "$prompt $" { fail "print unsigned int < (~0)" } | |
1593 | timeout { fail "(timeout) print unsigned int < (~0)" } | |
1594 | } | |
1595 | } | |
1596 | -re "$prompt $" { fail "print unsigned int < (~0)" } | |
1597 | timeout { fail "(timeout) print unsigned int < (~0)" } | |
1598 | } | |
1599 | ||
1600 | ||
1601 | send "set variable v_unsigned_int=~0\n" | |
1602 | expect { | |
1603 | -re "set.*$prompt $" { | |
1604 | send "print v_unsigned_int > 0\n" | |
1605 | expect { | |
1606 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1607 | send "print v_unsigned_int > 0x7FFF\n" | |
1608 | expect { | |
1609 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print unsigned int > (~0)" } | |
1610 | -re "$prompt $" { fail "print unsigned int > (~0)" } | |
1611 | timeout { fail "(timeout) print unsigned int > (~0)" } | |
1612 | } | |
1613 | } | |
1614 | -re "$prompt $" { fail "print unsigned int > (~0)" } | |
1615 | timeout { fail "(timeout) print unsigned int > (~0)" } | |
1616 | } | |
1617 | } | |
1618 | -re "$prompt $" { fail "print unsigned int > (~0)" } | |
1619 | timeout { fail "(timeout) print unsigned int > (~0)" } | |
1620 | } | |
1621 | ||
1622 | ||
1623 | # | |
1624 | # test expressions with "long" types | |
1625 | # | |
1626 | send "set variable v_long=0x7FFF\n" | |
1627 | expect { | |
1628 | -re "set.*$prompt $" { | |
1629 | send "print v_long == 0\n" | |
1630 | expect { | |
1631 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1632 | send "print v_long == 0x7FFF\n" | |
1633 | expect { | |
1634 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print signed long ==" } | |
1635 | -re "$prompt $" { fail "print signed long ==" } | |
1636 | timeout { fail "(timeout) print signed long ==" } | |
1637 | } | |
1638 | } | |
1639 | -re "$prompt $" { fail "print signed long ==" } | |
1640 | timeout { fail "(timeout) print signed long ==" } | |
1641 | } | |
1642 | } | |
1643 | -re "$prompt $" { fail "print signed long ==" } | |
1644 | timeout { fail "(timeout) print signed long ==" } | |
1645 | } | |
1646 | ||
1647 | ||
1648 | send "set variable v_long=0x7FFF\n" | |
1649 | expect { | |
1650 | -re "set.*$prompt $" { | |
1651 | send "print v_long != 0\n" | |
1652 | expect { | |
1653 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1654 | send "print v_long != 0x7FFF\n" | |
1655 | expect { | |
1656 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed long !=" } | |
1657 | -re "$prompt $" { fail "print signed long !=" } | |
1658 | timeout { fail "(timeout) print signed long !=" } | |
1659 | } | |
1660 | } | |
1661 | -re "$prompt $" { fail "print signed long !=" } | |
1662 | timeout { fail "(timeout) print signed long !=" } | |
1663 | } | |
1664 | } | |
1665 | -re "$prompt $" { fail "print signed long !=" } | |
1666 | timeout { fail "(timeout) print signed long !=" } | |
1667 | } | |
1668 | ||
1669 | ||
1670 | send "set variable v_long=0x7FFF\n" | |
1671 | expect { | |
1672 | -re "set.*$prompt $" { | |
1673 | send "print v_long < 0\n" | |
1674 | expect { | |
1675 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1676 | send "print v_long < 0x7FFF\n" | |
1677 | expect { | |
1678 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed long <" } | |
1679 | -re "$prompt $" { fail "print signed long <" } | |
1680 | timeout { fail "(timeout) print signed long <" } | |
1681 | } | |
1682 | } | |
1683 | -re "$prompt $" { fail "print signed long <" } | |
1684 | timeout { fail "(timeout) print signed long <" } | |
1685 | } | |
1686 | } | |
1687 | -re "$prompt $" { fail "print signed long <" } | |
1688 | timeout { fail "(timeout) print signed long <" } | |
1689 | } | |
1690 | ||
1691 | ||
1692 | send "set variable v_long=0x7FFF\n" | |
1693 | expect { | |
1694 | -re "set.*$prompt $" { | |
1695 | send "print v_long > 0\n" | |
1696 | expect { | |
1697 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1698 | send "print v_long > 0x7FFF\n" | |
1699 | expect { | |
1700 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed long >" } | |
1701 | -re "$prompt $" { fail "print signed long >" } | |
1702 | timeout { fail "(timeout) print signed long >" } | |
1703 | } | |
1704 | } | |
1705 | -re "$prompt $" { fail "print signed long >" } | |
1706 | timeout { fail "(timeout) print signed long >" } | |
1707 | } | |
1708 | } | |
1709 | -re "$prompt $" { fail "print signed long >" } | |
1710 | timeout { fail "(timeout) print signed long >" } | |
1711 | } | |
1712 | ||
1713 | ||
1714 | # make long a minus | |
1715 | send "set variable v_long=-1\n" | |
1716 | expect { | |
1717 | -re "set.*$prompt $" { | |
1718 | send "print v_long == 0\n" | |
1719 | expect { | |
1720 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1721 | send "print v_long == -1\n" | |
1722 | expect { | |
1723 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print signed long == (minus)" } | |
1724 | -re "$prompt $" { fail "print signed long == (minus)" } | |
1725 | timeout { fail "(timeout) print signed long == (minus)" } | |
1726 | } | |
1727 | } | |
1728 | -re "$prompt $" { fail "print signed long == (minus)" } | |
1729 | timeout { fail "(timeout) print signed long == (minus)" } | |
1730 | } | |
1731 | } | |
1732 | -re "$prompt $" { fail "print signed long == (minus)" } | |
1733 | timeout { fail "(timeout) print signed long == (minus)" } | |
1734 | } | |
1735 | ||
1736 | ||
1737 | send "set variable v_long=-1\n" | |
1738 | expect { | |
1739 | -re "set.*$prompt $" { | |
1740 | send "print v_long != 0\n" | |
1741 | expect { | |
1742 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1743 | send "print v_long != -1\n" | |
1744 | expect { | |
1745 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed long != (minus)" } | |
1746 | -re "$prompt $" { fail "print signed long != (minus)" } | |
1747 | timeout { fail "(timeout) print signed long != (minus)" } | |
1748 | } | |
1749 | } | |
1750 | -re "$prompt $" { fail "print signed long != (minus)" } | |
1751 | timeout { fail "(timeout) print signed long != (minus)" } | |
1752 | } | |
1753 | } | |
1754 | -re "$prompt $" { fail "print signed long != (minus)" } | |
1755 | timeout { fail "(timeout) print signed long != (minus)" } | |
1756 | } | |
1757 | ||
1758 | ||
1759 | send "set variable v_long=-1\n" | |
1760 | expect { | |
1761 | -re "set.*$prompt $" { | |
1762 | send "print v_long < 0\n" | |
1763 | expect { | |
1764 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1765 | send "print v_long < 0x7FFF\n" | |
1766 | expect { | |
1767 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print signed long < (minus)" } | |
1768 | -re "$prompt $" { fail "print signed long < (minus)" } | |
1769 | timeout { fail "(timeout) print signed long < (minus)" } | |
1770 | } | |
1771 | } | |
1772 | -re "$prompt $" { fail "print signed long < (minus)" } | |
1773 | timeout { fail "(timeout) print signed long < (minus)" } | |
1774 | } | |
1775 | } | |
1776 | -re "$prompt $" { fail "print signed long < (minus)" } | |
1777 | timeout { fail "(timeout) print signed long < (minus)" } | |
1778 | } | |
1779 | ||
1780 | ||
1781 | send "set variable v_long=-1\n" | |
1782 | expect { | |
1783 | -re "set.*$prompt $" { | |
1784 | send "print v_long > 0\n" | |
1785 | expect { | |
1786 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1787 | send "print v_long > 0x7FFF\n" | |
1788 | expect { | |
1789 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed long > (minus)" } | |
1790 | -re "$prompt $" { fail "print signed long > (minus)" } | |
1791 | timeout { fail "(timeout) print signed long > (minus)" } | |
1792 | } | |
1793 | } | |
1794 | -re "$prompt $" { fail "print signed long > (minus)" } | |
1795 | timeout { fail "(timeout) print signed long > (minus)" } | |
1796 | } | |
1797 | } | |
1798 | -re "$prompt $" { fail "print signed long > (minus)" } | |
1799 | timeout { fail "(timeout) print signed long > (minus)" } | |
1800 | } | |
1801 | ||
1802 | ||
1803 | # | |
1804 | # test expressions with "signed long" types | |
1805 | # | |
1806 | send "set variable v_signed_long=0x7FFF\n" | |
1807 | expect { | |
1808 | -re "set.*$prompt $" { | |
1809 | send "print v_signed_long == 0\n" | |
1810 | expect { | |
1811 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1812 | send "print v_signed_long == 0x7FFF\n" | |
1813 | expect { | |
1814 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print signed signed long ==" } | |
1815 | -re "$prompt $" { fail "print signed signed long ==" } | |
1816 | timeout { fail "(timeout) print signed signed long ==" } | |
1817 | } | |
1818 | } | |
1819 | -re "$prompt $" { fail "print signed signed long ==" } | |
1820 | timeout { fail "(timeout) print signed signed long ==" } | |
1821 | } | |
1822 | } | |
1823 | -re "$prompt $" { fail "print signed signed long ==" } | |
1824 | timeout { fail "(timeout) print signed signed long ==" } | |
1825 | } | |
1826 | ||
1827 | ||
1828 | send "set variable v_signed_long=0x7FFF\n" | |
1829 | expect { | |
1830 | -re "set.*$prompt $" { | |
1831 | send "print v_signed_long != 0\n" | |
1832 | expect { | |
1833 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1834 | send "print v_signed_long != 0x7FFF\n" | |
1835 | expect { | |
1836 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed signed long !=" } | |
1837 | -re "$prompt $" { fail "print signed signed long !=" } | |
1838 | timeout { fail "(timeout) print signed signed long !=" } | |
1839 | } | |
1840 | } | |
1841 | -re "$prompt $" { fail "print signed signed long !=" } | |
1842 | timeout { fail "(timeout) print signed signed long !=" } | |
1843 | } | |
1844 | } | |
1845 | -re "$prompt $" { fail "print signed signed long !=" } | |
1846 | timeout { fail "(timeout) print signed signed long !=" } | |
1847 | } | |
1848 | ||
1849 | ||
1850 | send "set variable v_signed_long=0x7FFF\n" | |
1851 | expect { | |
1852 | -re "set.*$prompt $" { | |
1853 | send "print v_signed_long < 0\n" | |
1854 | expect { | |
1855 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1856 | send "print v_signed_long < 0x7FFF\n" | |
1857 | expect { | |
1858 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed signed long <" } | |
1859 | -re "$prompt $" { fail "print signed signed long <" } | |
1860 | timeout { fail "(timeout) print signed signed long <" } | |
1861 | } | |
1862 | } | |
1863 | -re "$prompt $" { fail "print signed signed long <" } | |
1864 | timeout { fail "(timeout) print signed signed long <" } | |
1865 | } | |
1866 | } | |
1867 | -re "$prompt $" { fail "print signed signed long <" } | |
1868 | timeout { fail "(timeout) print signed signed long <" } | |
1869 | } | |
1870 | ||
1871 | ||
1872 | send "set variable v_signed_long=0x7FFF\n" | |
1873 | expect { | |
1874 | -re "set.*$prompt $" { | |
1875 | send "print v_signed_long > 0\n" | |
1876 | expect { | |
1877 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1878 | send "print v_signed_long > 0x7FFF\n" | |
1879 | expect { | |
1880 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed signed long >" } | |
1881 | -re "$prompt $" { fail "print signed signed long >" } | |
1882 | timeout { fail "(timeout) print signed signed long >" } | |
1883 | } | |
1884 | } | |
1885 | -re "$prompt $" { fail "print signed signed long >" } | |
1886 | timeout { fail "(timeout) print signed signed long >" } | |
1887 | } | |
1888 | } | |
1889 | -re "$prompt $" { fail "print signed signed long >" } | |
1890 | timeout { fail "(timeout) print signed signed long >" } | |
1891 | } | |
1892 | ||
1893 | ||
1894 | # make long a minus | |
1895 | send "set variable v_signed_long=-1\n" | |
1896 | expect { | |
1897 | -re "set.*$prompt $" { | |
1898 | send "print v_signed_long == 0\n" | |
1899 | expect { | |
1900 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1901 | send "print v_signed_long == -1\n" | |
1902 | expect { | |
1903 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print signed signed long == (minus)" } | |
1904 | -re "$prompt $" { fail "print signed signed long == (minus)" } | |
1905 | timeout { fail "(timeout) print signed signed long == (minus)" } | |
1906 | } | |
1907 | } | |
1908 | -re "$prompt $" { fail "print signed signed long == (minus)" } | |
1909 | timeout { fail "(timeout) print signed signed long == (minus)" } | |
1910 | } | |
1911 | } | |
1912 | -re "$prompt $" { fail "print signed signed long == (minus)" } | |
1913 | timeout { fail "(timeout) print signed signed long == (minus)" } | |
1914 | } | |
1915 | ||
1916 | ||
1917 | send "set variable v_signed_long=-1\n" | |
1918 | expect { | |
1919 | -re "set.*$prompt $" { | |
1920 | send "print v_signed_long != 0\n" | |
1921 | expect { | |
1922 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1923 | send "print v_signed_long != -1\n" | |
1924 | expect { | |
1925 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed signed long != (minus)" } | |
1926 | -re "$prompt $" { fail "print signed signed long != (minus)" } | |
1927 | timeout { fail "(timeout) print signed signed long != (minus)" } | |
1928 | } | |
1929 | } | |
1930 | -re "$prompt $" { fail "print signed signed long != (minus)" } | |
1931 | timeout { fail "(timeout) print signed signed long != (minus)" } | |
1932 | } | |
1933 | } | |
1934 | -re "$prompt $" { fail "print signed signed long != (minus)" } | |
1935 | timeout { fail "(timeout) print signed signed long != (minus)" } | |
1936 | } | |
1937 | ||
1938 | ||
1939 | send "set variable v_signed_long=-1\n" | |
1940 | expect { | |
1941 | -re "set.*$prompt $" { | |
1942 | send "print v_signed_long < 0\n" | |
1943 | expect { | |
1944 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
1945 | send "print v_signed_long < 0x7FFF\n" | |
1946 | expect { | |
1947 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print signed signed long < (minus)" } | |
1948 | -re "$prompt $" { fail "print signed signed long < (minus)" } | |
1949 | timeout { fail "(timeout) print signed signed long < (minus)" } | |
1950 | } | |
1951 | } | |
1952 | -re "$prompt $" { fail "print signed signed long < (minus)" } | |
1953 | timeout { fail "(timeout) print signed signed long < (minus)" } | |
1954 | } | |
1955 | } | |
1956 | -re "$prompt $" { fail "print signed signed long < (minus)" } | |
1957 | timeout { fail "(timeout) print signed signed long < (minus)" } | |
1958 | } | |
1959 | ||
1960 | ||
1961 | send "set variable v_signed_long=-1\n" | |
1962 | expect { | |
1963 | -re "set.*$prompt $" { | |
1964 | send "print v_signed_long > 0\n" | |
1965 | expect { | |
1966 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1967 | send "print v_signed_long > 0x7FFF\n" | |
1968 | expect { | |
1969 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print signed signed long > (minus)" } | |
1970 | -re "$prompt $" { fail "print signed signed long > (minus)" } | |
1971 | timeout { fail "(timeout) print signed signed long > (minus)" } | |
1972 | } | |
1973 | } | |
1974 | -re "$prompt $" { fail "print signed signed long > (minus)" } | |
1975 | timeout { fail "(timeout) print signed signed long > (minus)" } | |
1976 | } | |
1977 | } | |
1978 | -re "$prompt $" { fail "print signed signed long > (minus)" } | |
1979 | timeout { fail "(timeout) print signed signed long > (minus)" } | |
1980 | } | |
1981 | ||
1982 | ||
1983 | # | |
1984 | # test expressions with "unsigned long" types | |
1985 | # | |
1986 | send "set variable v_unsigned_long=0x7FFF\n" | |
1987 | expect { | |
1988 | -re "set.*$prompt $" { | |
1989 | send "print v_unsigned_long == 0\n" | |
1990 | expect { | |
1991 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
1992 | send "print v_unsigned_long == 0x7FFF\n" | |
1993 | expect { | |
1994 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print unsigned long ==" } | |
1995 | -re "$prompt $" { fail "print unsigned long ==" } | |
1996 | timeout { fail "(timeout) print unsigned long ==" } | |
1997 | } | |
1998 | } | |
1999 | -re "$prompt $" { fail "print unsigned long ==" } | |
2000 | timeout { fail "(timeout) print unsigned long ==" } | |
2001 | } | |
2002 | } | |
2003 | -re "$prompt $" { fail "print unsigned long ==" } | |
2004 | timeout { fail "(timeout) print unsigned long ==" } | |
2005 | } | |
2006 | ||
2007 | ||
2008 | send "set variable v_unsigned_long=0x7FFF\n" | |
2009 | expect { | |
2010 | -re "set.*$prompt $" { | |
2011 | send "print v_unsigned_long != 0\n" | |
2012 | expect { | |
2013 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
2014 | send "print v_unsigned_long != 0x7FFF\n" | |
2015 | expect { | |
2016 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print unsigned long !=" } | |
2017 | -re "$prompt $" { fail "print unsigned long !=" } | |
2018 | timeout { fail "(timeout) print unsigned long !=" } | |
2019 | } | |
2020 | } | |
2021 | -re "$prompt $" { fail "print unsigned long !=" } | |
2022 | timeout { fail "(timeout) print unsigned long !=" } | |
2023 | } | |
2024 | } | |
2025 | -re "$prompt $" { fail "print unsigned long !=" } | |
2026 | timeout { fail "(timeout) print unsigned long !=" } | |
2027 | } | |
2028 | ||
2029 | ||
2030 | send "set variable v_unsigned_long=0x7FFF\n" | |
2031 | expect { | |
2032 | -re "set.*$prompt $" { | |
2033 | send "print v_unsigned_long < 0\n" | |
2034 | expect { | |
2035 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
2036 | send "print v_unsigned_long < 0x7FFF\n" | |
2037 | expect { | |
2038 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print unsigned long <" } | |
2039 | -re "$prompt $" { fail "print unsigned long <" } | |
2040 | timeout { fail "(timeout) print unsigned long <" } | |
2041 | } | |
2042 | } | |
2043 | -re "$prompt $" { fail "print unsigned long <" } | |
2044 | timeout { fail "(timeout) print unsigned long <" } | |
2045 | } | |
2046 | } | |
2047 | -re "$prompt $" { fail "print unsigned long <" } | |
2048 | timeout { fail "(timeout) print unsigned long <" } | |
2049 | } | |
2050 | ||
2051 | ||
2052 | send "set variable v_unsigned_long=0x7FFF\n" | |
2053 | expect { | |
2054 | -re "set.*$prompt $" { | |
2055 | send "print v_unsigned_long > 0\n" | |
2056 | expect { | |
2057 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
2058 | send "print v_unsigned_long > 0x7FFF\n" | |
2059 | expect { | |
2060 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print unsigned long >" } | |
2061 | -re "$prompt $" { fail "print unsigned long >" } | |
2062 | timeout { fail "(timeout) print unsigned long >" } | |
2063 | } | |
2064 | } | |
2065 | -re "$prompt $" { fail "print unsigned long >" } | |
2066 | timeout { fail "(timeout) print unsigned long >" } | |
2067 | } | |
2068 | } | |
2069 | -re "$prompt $" { fail "print unsigned long >" } | |
2070 | timeout { fail "(timeout) print unsigned long >" } | |
2071 | } | |
2072 | ||
2073 | ||
2074 | # make long a minus | |
2075 | send "set variable v_unsigned_long=~0\n" | |
2076 | expect { | |
2077 | -re "set.*$prompt $" { | |
2078 | send "print v_unsigned_long == 0\n" | |
2079 | expect { | |
2080 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
2081 | send "print v_unsigned_long == ~0\n" | |
2082 | expect { | |
2083 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
2084 | send "print v_unsigned_long == (unsigned long)~0\n" | |
2085 | expect { | |
2086 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print unsigned long == (~0)" } | |
2087 | -re "$prompt $" { fail "print unsigned long == (~0)" } | |
2088 | timeout { fail "(timeout) print unsigned long == (~0)" } | |
2089 | } | |
2090 | } | |
2091 | -re "$prompt $" { fail "print unsigned long == (~0)" } | |
2092 | timeout { fail "(timeout) print unsigned long == (~0)" } | |
2093 | } | |
2094 | } | |
2095 | -re "$prompt $" { fail "print unsigned long == (~0)" } | |
2096 | timeout { fail "(timeout) print unsigned long == (~0)" } | |
2097 | } | |
2098 | } | |
2099 | -re "$prompt $" { fail "print unsigned long == (~0)" } | |
2100 | timeout { fail "(timeout) print unsigned long == (~0)" } | |
2101 | } | |
2102 | ||
2103 | ||
2104 | send "set variable v_unsigned_long=~0\n" | |
2105 | expect { | |
2106 | -re "set.*$prompt $" { | |
2107 | send "print v_unsigned_long != 0\n" | |
2108 | expect { | |
2109 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
2110 | send "print v_unsigned_long != (unsigned long)~0\n" | |
2111 | expect { | |
2112 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print unsigned long != (~0)" } | |
2113 | -re "$prompt $" { fail "print unsigned long != (~0)" } | |
2114 | timeout { fail "(timeout) print unsigned long != (~0)" } | |
2115 | } | |
2116 | } | |
2117 | -re "$prompt $" { fail "print unsigned long != (~0)" } | |
2118 | timeout { fail "(timeout) print unsigned long != (~0)" } | |
2119 | } | |
2120 | } | |
2121 | -re "$prompt $" { fail "print unsigned long != (~0)" } | |
2122 | timeout { fail "(timeout) print unsigned long != (~0)" } | |
2123 | } | |
2124 | ||
2125 | ||
2126 | send "set variable v_unsigned_long=~0\n" | |
2127 | expect { | |
2128 | -re "set.*$prompt $" { | |
2129 | send "print v_unsigned_long < 0\n" | |
2130 | expect { | |
2131 | -re "print.*.\[0-9\]* = 0.*$prompt $" { | |
2132 | send "print v_unsigned_long < 0x7FFF\n" | |
2133 | expect { | |
2134 | -re "print.*.\[0-9\]* = 0.*$prompt $" { pass "print unsigned long < (~0)" } | |
2135 | -re "$prompt $" { fail "print unsigned long < (~0)" } | |
2136 | timeout { fail "(timeout) print unsigned long < (~0)" } | |
2137 | } | |
2138 | } | |
2139 | -re "$prompt $" { fail "print unsigned long < (~0)" } | |
2140 | timeout { fail "(timeout) print unsigned long < (~0)" } | |
2141 | } | |
2142 | } | |
2143 | -re "$prompt $" { fail "print unsigned long < (~0)" } | |
2144 | timeout { fail "(timeout) print unsigned long < (~0)" } | |
2145 | } | |
2146 | ||
2147 | ||
2148 | send "set variable v_unsigned_long=~0\n" | |
2149 | expect { | |
2150 | -re "set.*$prompt $" { | |
2151 | send "print v_unsigned_long > 0\n" | |
2152 | expect { | |
2153 | -re "print.*.\[0-9\]* = 1.*$prompt $" { | |
2154 | send "print v_unsigned_long > 0x7FFF\n" | |
2155 | expect { | |
2156 | -re "print.*.\[0-9\]* = 1.*$prompt $" { pass "print unsigned long > (~0)" } | |
2157 | -re "$prompt $" { fail "print unsigned long > (~0)" } | |
2158 | timeout { fail "(timeout) print unsigned long > (~0)" } | |
2159 | } | |
2160 | } | |
2161 | -re "$prompt $" { fail "print unsigned long > (~0)" } | |
2162 | timeout { fail "(timeout) print unsigned long > (~0)" } | |
2163 | } | |
2164 | } | |
2165 | -re "$prompt $" { fail "print unsigned long > (~0)" } | |
2166 | timeout { fail "(timeout) print unsigned long > (~0)" } | |
2167 | } | |
2168 | ||
2169 | if [istarget "a29k-*-udi"] then { | |
2170 | # FIXME: If PR 2415 is fixed, this is not needed. | |
2171 | gdb_target_udi | |
2172 | } |