1 # Copyright
1998, 1999 Free Software Foundation
, Inc.
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.
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.
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.
, 59 Temple Place
- Suite
330, Boston
, MA
02111-1307, USA.
17 # Please email
any bugs
, comments
, and
/or additions to this file to
:
18 # bug
-gdb@prep.ai.mit.edu
20 # This file was written by Elena Zannoni
(ezannoni@cygnus.com
)
22 # This file is part of the gdb testsuite
24 # tests expressions with bitwise operators
, and some
26 # Does not use a target
program
35 # test running programs
43 gdb_reinitialize_dir $srcdir
/$subdir
48 -re
".\[0-9\]* = 0.*$gdb_prompt $" {
49 pass
"print value of !1"
51 -re
".*$gdb_prompt $" { fail "print value of !1" }
52 timeout
{ fail
"(timeout) print value of !1" }
58 -re
".\[0-9\]* = 1.*$gdb_prompt $" {
59 pass
"print value of !0"
61 -re
".*$gdb_prompt $" { fail "print value of !0" }
62 timeout
{ fail
"(timeout) print value of !0" }
66 send_gdb
"print !100\n"
68 -re
".\[0-9\]* = 0.*$gdb_prompt $" {
69 pass
"print value of !100"
71 -re
".*$gdb_prompt $" { fail "print value of !100" }
72 timeout
{ fail
"(timeout) print value of !100" }
76 send_gdb
"print !1000\n"
78 -re
".\[0-9\]* = 0.*$gdb_prompt $" {
79 pass
"print value of !1000"
81 -re
".*$gdb_prompt $" { fail "print value of !1000" }
82 timeout
{ fail
"(timeout) print value of !1000" }
86 send_gdb
"print !10\n"
88 -re
".\[0-9\]* = 0.*$gdb_prompt $" {
89 pass
"print value of !10"
91 -re
".*$gdb_prompt $" { fail "print value of !10" }
92 timeout
{ fail
"(timeout) print value of !10" }
98 -re
".\[0-9\]* = 0.*$gdb_prompt $" {
99 pass
"print value of !2 "
101 -re
".*$gdb_prompt $" { fail "print value of !2" }
102 timeout
{ fail
"(timeout) print value of !2" }
106 send_gdb
"print 10 | 5\n"
108 -re
".\[0-9\]* = 15.*$gdb_prompt $" {
109 pass
"print value of 10 | 5"
111 -re
".*$gdb_prompt $" { fail "print value of 10 | 5" }
112 timeout
{ fail
"(timeout) print value of 10 | 5" }
116 send_gdb
"print 10 & 5\n"
118 -re
".\[0-9\]* = 0.*$gdb_prompt $" {
119 pass
"print value of 10 & 5"
121 -re
".*$gdb_prompt $" { fail "print value of 10 & 5" }
122 timeout
{ fail
"(timeout) print value of 10 & 5" }
126 send_gdb
"print 10 ^ 5\n"
128 -re
".\[0-9\]* = 15.*$gdb_prompt $" {
129 pass
"print value of 10 ^ 5"
131 -re
".*$gdb_prompt $" { fail "print value of 10 ^ 5" }
132 timeout
{ fail
"(timeout) print value of 10 ^ 5" }
136 send_gdb
"print -!0\n"
138 -re
".\[0-9\]* = -1.*$gdb_prompt $" {
139 pass
"print value of -!0"
141 -re
".*$gdb_prompt $" { fail "print value of -!0" }
142 timeout
{ fail
"(timeout) print value of -!0" }
146 send_gdb
"print ~-!0\n"
148 -re
".\[0-9\]* = 0.*$gdb_prompt $" {
149 pass
"print value of ~-!0"
151 -re
".*$gdb_prompt $" { fail "print value of ~-!0" }
152 timeout
{ fail
"(timeout) print value of ~-!0" }
157 send_gdb
"print 3 * 2 / 4.0 * 2.0\n"
159 -re
".\[0-9\]* = 3.*$gdb_prompt $" {
160 pass
"print value of 3 * 2 / 4.0 * 2.0"
162 -re
".*$gdb_prompt $" { fail "print value of 3 * 2 / 4.0 * 2.0" }
163 timeout
{ fail
"(timeout) print value of 3 * 2 / 4.0 * 2.0" }
167 send_gdb
"print 8 << 2 >> 4\n"
169 -re
".\[0-9\]* = 2.*$gdb_prompt $" {
170 pass
"print value of 8 << 2 >> 4"
172 -re
".*$gdb_prompt $" { fail "print value of 8 << 2 >> 4" }
173 timeout
{ fail
"(timeout) print value of 8 << 2 >> 4" }
177 send_gdb
"print -1 < 0 > 1\n"
179 -re
".\[0-9\]* = 0.*$gdb_prompt $" {
180 pass
"print value of -1 < 0 > 1"
182 -re
".*$gdb_prompt $" { fail "print value of -1 < 0 > 1" }
183 timeout
{ fail
"(timeout) print value of -1 < 0 > 1" }
187 send_gdb
"print 15 ^ 10 ^ 5 ^ 7\n"
189 -re
".\[0-9\]* = 7.*$gdb_prompt $" {
190 pass
"print value of 15 ^ 10 ^ 5 ^ 7"
192 -re
".*$gdb_prompt $" { fail "print value of 15 ^ 10 ^ 5 ^ 7" }
193 timeout
{ fail
"(timeout) print value of 15 ^ 10 ^ 5 ^ 7" }
197 send_gdb
"print 3.5 < 4.0\n"
199 -re
".\[0-9\]* = 1.*$gdb_prompt $" {
200 pass
"print value of 3.5 < 4.0"
202 -re
".*$gdb_prompt $" { fail "print value of 3.5 < 4.0" }
203 timeout
{ fail
"(timeout) print value of 3.5 < 4.0" }
207 send_gdb
"print 3.5 < -4.0\n"
209 -re
".\[0-9\]* = 0.*$gdb_prompt $" {
210 pass
"print value of 3.5 < -4.0"
212 -re
".*$gdb_prompt $" { fail "print value of 3.5 < -4.0" }
213 timeout
{ fail
"(timeout) print value of 3.5 < -4.0" }
217 send_gdb
"print 2 > -3\n"
219 -re
".\[0-9\]* = 1.*$gdb_prompt $" {
220 pass
"print value of 2 > -3"
222 -re
".*$gdb_prompt $" { fail "print value of 2 > -3" }
223 timeout
{ fail
"(timeout) print value of 2 > -3" }
227 send_gdb
"print -3>4\n"
229 -re
".\[0-9\]* = 0.*$gdb_prompt $" {
230 pass
"print value of -3>4"
232 -re
".*$gdb_prompt $" { fail "print value of -3>4" }
233 timeout
{ fail
"(timeout) print value of -3>4" }
237 send_gdb
"print (-3 > 4)\n"
239 -re
".\[0-9\]* = 0.*$gdb_prompt $" {
240 pass
"print value of (-3 > 4)"
242 -re
".*$gdb_prompt $" { fail "print value of (-3 > 4)" }
243 timeout
{ fail
"(timeout) print value of (-3 > 4)" }
247 send_gdb
"print 3>=2.5\n"
249 -re
".\[0-9\]* = 1.*$gdb_prompt $" {
250 pass
"print value of 3>=2.5"
252 -re
".*$gdb_prompt $" { fail "print value of 3>=2.5" }
253 timeout
{ fail
"(timeout) print value of 3>=2.5" }
257 send_gdb
"print 3>=4.5\n"
259 -re
".\[0-9\]* = 0.*$gdb_prompt $" {
260 pass
"print value of 3>=4.5"
262 -re
".*$gdb_prompt $" { fail "print value of 3>=4.5" }
263 timeout
{ fail
"(timeout) print value of 3>=4.5" }
267 send_gdb
"print 3==3.0\n"
269 -re
".\[0-9\]* = 1.*$gdb_prompt $" {
270 pass
"print value of 3==3.0"
272 -re
".*$gdb_prompt $" { fail "print value of 3==3.0" }
273 timeout
{ fail
"(timeout) print value of 3==3.0" }
277 send_gdb
"print 3==4.0\n"
279 -re
".\[0-9\]* = 0.*$gdb_prompt $" {
280 pass
"print value of 3==4.0"
282 -re
".*$gdb_prompt $" { fail "print value of 3==4.0" }
283 timeout
{ fail
"(timeout) print value of 3==4.0" }
287 send_gdb
"print 3!=3.0\n"
289 -re
".\[0-9\]* = 0.*$gdb_prompt $" {
290 pass
"print value of 3!=3.0"
292 -re
".*$gdb_prompt $" { fail "print value of 3!=3.0" }
293 timeout
{ fail
"(timeout) print value of 3!=3.0" }
297 send_gdb
"print 3!=5.0\n"
299 -re
".\[0-9\]* = 1.*$gdb_prompt $" {
300 pass
"print value of 3!=5.0"
302 -re
".*$gdb_prompt $" { fail "print value of 3!=5.0" }
303 timeout
{ fail
"(timeout) print value of 3!=5.0" }
307 send_gdb
"print 0 || 1 && 0 | 0 ^ 0 == 8 > 128 >>1 +2 *2\n"
309 -re
".\[0-9\]* = 0.*$gdb_prompt $" {
310 pass
"print value of 0 || 1 && 0 | 0 ^ 0 == 8 > 128 >>1 +2 *2"
312 -re
".*$gdb_prompt $" { fail "print value of 0 || 1 && 0 | 0 ^ 0 == 8 > 128 >>1 +2 *2" }
313 timeout
{ fail
"(timeout) print value of 0 || 1 && 0 | 0 ^ 0 == 8 > 128 >>1 +2 *2" }
317 send_gdb
"print 1.0 || 0\n"
319 -re
".\[0-9\]* = 1.*$gdb_prompt $" {
320 pass
"print value of 1.0 || 0"
322 -re
".*$gdb_prompt $" { fail "print value of 1.0 || 0" }
323 timeout
{ fail
"(timeout) print value of 1.0 || 0" }
327 send_gdb
"print 0.0 || 1.0\n"
329 -re
".\[0-9\]* = 1.*$gdb_prompt $" {
330 pass
"print value of 0.0 || 1.0"
332 -re
".*$gdb_prompt $" { fail "print value of 0.0 || 1.0" }
333 timeout
{ fail
"(timeout) print value of 0.0 || 1.0" }
337 send_gdb
"print 0.0 || 0\n"
339 -re
".\[0-9\]* = 0.*$gdb_prompt $" {
340 pass
"print value of 0.0 || 0"
342 -re
".*$gdb_prompt $" { fail "print value of 0.0 || 0" }
343 timeout
{ fail
"(timeout) print value of 0.0 || 0" }
347 send_gdb
"print 0 || 1 && 0 | 0 ^ 0 == 8\n"
349 -re
".\[0-9\]* = 0.*$gdb_prompt $" {
350 pass
"print value of 0 || 1 && 0 | 0 ^ 0 == 8"
352 -re
".*$gdb_prompt $" { fail "print value of 0 || 1 && 0 | 0 ^ 0 == 8" }
353 timeout
{ fail
"(timeout) print value of 0 || 1 && 0 | 0 ^ 0 == 8" }
357 send_gdb
"print 0 == 8 > 128 >> 1 + 2 * 2\n"
359 -re
".\[0-9\]* = 0.*$gdb_prompt $" {
360 pass
"print value of 0 == 8 > 128 >> 1 + 2 * 2"
362 -re
".*$gdb_prompt $" { fail "print value of 0 == 8 > 128 >> 1 + 2 * 2" }
363 timeout
{ fail
"(timeout) print value of 0 == 8 > 128 >> 1 + 2 * 2" }