aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/bitops.exp
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2010-05-26 18:05:25 +0000
committerMichael Snyder <msnyder@vmware.com>2010-05-26 18:05:25 +0000
commit6acb16a2933eda8acd00095c425e32cf5ef171cb (patch)
treede3d1b0b64286b4a9712054e1a7e1b2d84228564 /gdb/testsuite/gdb.base/bitops.exp
parentdfc8cf43a16e6e304c311bad583594485657cf8a (diff)
downloadgdb-6acb16a2933eda8acd00095c425e32cf5ef171cb.zip
gdb-6acb16a2933eda8acd00095c425e32cf5ef171cb.tar.gz
gdb-6acb16a2933eda8acd00095c425e32cf5ef171cb.tar.bz2
2010-05-25 Michael Snyder <msnyder@vmware.com>
* gdb.ada/formatted_ref.exp: Replace send_gdb with gdb_test. * gdb.asm/asm-source.exp: Replace send_gdb with gdb_test. * gdb.base/a2-run.exp: Replace send_gdb with gdb_test. * gdb.base/all-bin.exp: Replace send_gdb with gdb_test. * gdb.base/annota1.exp: Replace send_gdb with gdb_test. * gdb.base/annota3.exp: Replace send_gdb with gdb_test. * gdb.base/assign.exp: Replace send_gdb with gdb_test. * gdb.base/attach.exp: Replace send_gdb with gdb_test. * gdb.base/bitfields.exp: Replace send_gdb with gdb_test. * gdb.base/bitfields2.exp: Replace send_gdb with gdb_test. * gdb.base/bitops.exp: Replace send_gdb with gdb_test.
Diffstat (limited to 'gdb/testsuite/gdb.base/bitops.exp')
-rw-r--r--gdb/testsuite/gdb.base/bitops.exp393
1 files changed, 75 insertions, 318 deletions
diff --git a/gdb/testsuite/gdb.base/bitops.exp b/gdb/testsuite/gdb.base/bitops.exp
index 634d4a6..12c8f3b 100644
--- a/gdb/testsuite/gdb.base/bitops.exp
+++ b/gdb/testsuite/gdb.base/bitops.exp
@@ -37,323 +37,80 @@ gdb_start
gdb_reinitialize_dir $srcdir/$subdir
-send_gdb "print !1\n"
-gdb_expect {
- -re ".\[0-9\]* = 0.*$gdb_prompt $" {
- pass "print value of !1"
- }
- -re ".*$gdb_prompt $" { fail "print value of !1" }
- timeout { fail "(timeout) print value of !1" }
- }
-
-
-send_gdb "print !0\n"
-gdb_expect {
- -re ".\[0-9\]* = 1.*$gdb_prompt $" {
- pass "print value of !0"
- }
- -re ".*$gdb_prompt $" { fail "print value of !0" }
- timeout { fail "(timeout) print value of !0" }
- }
-
-
-send_gdb "print !100\n"
-gdb_expect {
- -re ".\[0-9\]* = 0.*$gdb_prompt $" {
- pass "print value of !100"
- }
- -re ".*$gdb_prompt $" { fail "print value of !100" }
- timeout { fail "(timeout) print value of !100" }
- }
-
-
-send_gdb "print !1000\n"
-gdb_expect {
- -re ".\[0-9\]* = 0.*$gdb_prompt $" {
- pass "print value of !1000"
- }
- -re ".*$gdb_prompt $" { fail "print value of !1000" }
- timeout { fail "(timeout) print value of !1000" }
- }
-
-
-send_gdb "print !10\n"
-gdb_expect {
- -re ".\[0-9\]* = 0.*$gdb_prompt $" {
- pass "print value of !10"
- }
- -re ".*$gdb_prompt $" { fail "print value of !10" }
- timeout { fail "(timeout) print value of !10" }
- }
-
-
-send_gdb "print !2\n"
-gdb_expect {
- -re ".\[0-9\]* = 0.*$gdb_prompt $" {
- pass "print value of !2 "
- }
- -re ".*$gdb_prompt $" { fail "print value of !2" }
- timeout { fail "(timeout) print value of !2" }
- }
-
-
-send_gdb "print 10 | 5\n"
-gdb_expect {
- -re ".\[0-9\]* = 15.*$gdb_prompt $" {
- pass "print value of 10 | 5"
- }
- -re ".*$gdb_prompt $" { fail "print value of 10 | 5" }
- timeout { fail "(timeout) print value of 10 | 5" }
- }
-
-
-send_gdb "print 10 & 5\n"
-gdb_expect {
- -re ".\[0-9\]* = 0.*$gdb_prompt $" {
- pass "print value of 10 & 5"
- }
- -re ".*$gdb_prompt $" { fail "print value of 10 & 5" }
- timeout { fail "(timeout) print value of 10 & 5" }
- }
-
-
-send_gdb "print 10 ^ 5\n"
-gdb_expect {
- -re ".\[0-9\]* = 15.*$gdb_prompt $" {
- pass "print value of 10 ^ 5"
- }
- -re ".*$gdb_prompt $" { fail "print value of 10 ^ 5" }
- timeout { fail "(timeout) print value of 10 ^ 5" }
- }
-
-
-send_gdb "print -!0\n"
-gdb_expect {
- -re ".\[0-9\]* = -1.*$gdb_prompt $" {
- pass "print value of -!0"
- }
- -re ".*$gdb_prompt $" { fail "print value of -!0" }
- timeout { fail "(timeout) print value of -!0" }
- }
-
-
-send_gdb "print ~-!0\n"
-gdb_expect {
- -re ".\[0-9\]* = 0.*$gdb_prompt $" {
- pass "print value of ~-!0"
- }
- -re ".*$gdb_prompt $" { fail "print value of ~-!0" }
- timeout { fail "(timeout) print value of ~-!0" }
- }
-
-
-
-send_gdb "print 3 * 2 / 4.0 * 2.0\n"
-gdb_expect {
- -re ".\[0-9\]* = 3.*$gdb_prompt $" {
- pass "print value of 3 * 2 / 4.0 * 2.0"
- }
- -re ".*$gdb_prompt $" { fail "print value of 3 * 2 / 4.0 * 2.0" }
- timeout { fail "(timeout) print value of 3 * 2 / 4.0 * 2.0" }
- }
-
-
-send_gdb "print 8 << 2 >> 4\n"
-gdb_expect {
- -re ".\[0-9\]* = 2.*$gdb_prompt $" {
- pass "print value of 8 << 2 >> 4"
- }
- -re ".*$gdb_prompt $" { fail "print value of 8 << 2 >> 4" }
- timeout { fail "(timeout) print value of 8 << 2 >> 4" }
- }
-
-
-send_gdb "print -1 < 0 > 1\n"
-gdb_expect {
- -re ".\[0-9\]* = 0.*$gdb_prompt $" {
- pass "print value of -1 < 0 > 1"
- }
- -re ".*$gdb_prompt $" { fail "print value of -1 < 0 > 1" }
- timeout { fail "(timeout) print value of -1 < 0 > 1" }
- }
-
-
-send_gdb "print 15 ^ 10 ^ 5 ^ 7\n"
-gdb_expect {
- -re ".\[0-9\]* = 7.*$gdb_prompt $" {
- pass "print value of 15 ^ 10 ^ 5 ^ 7"
- }
- -re ".*$gdb_prompt $" { fail "print value of 15 ^ 10 ^ 5 ^ 7" }
- timeout { fail "(timeout) print value of 15 ^ 10 ^ 5 ^ 7" }
- }
-
-
-send_gdb "print 3.5 < 4.0\n"
-gdb_expect {
- -re ".\[0-9\]* = 1.*$gdb_prompt $" {
- pass "print value of 3.5 < 4.0"
- }
- -re ".*$gdb_prompt $" { fail "print value of 3.5 < 4.0" }
- timeout { fail "(timeout) print value of 3.5 < 4.0" }
- }
-
-
-send_gdb "print 3.5 < -4.0\n"
-gdb_expect {
- -re ".\[0-9\]* = 0.*$gdb_prompt $" {
- pass "print value of 3.5 < -4.0"
- }
- -re ".*$gdb_prompt $" { fail "print value of 3.5 < -4.0" }
- timeout { fail "(timeout) print value of 3.5 < -4.0" }
- }
-
-
-send_gdb "print 2 > -3\n"
-gdb_expect {
- -re ".\[0-9\]* = 1.*$gdb_prompt $" {
- pass "print value of 2 > -3"
- }
- -re ".*$gdb_prompt $" { fail "print value of 2 > -3" }
- timeout { fail "(timeout) print value of 2 > -3" }
- }
-
-
-send_gdb "print -3>4\n"
-gdb_expect {
- -re ".\[0-9\]* = 0.*$gdb_prompt $" {
- pass "print value of -3>4"
- }
- -re ".*$gdb_prompt $" { fail "print value of -3>4" }
- timeout { fail "(timeout) print value of -3>4" }
- }
-
-
-send_gdb "print (-3 > 4)\n"
-gdb_expect {
- -re ".\[0-9\]* = 0.*$gdb_prompt $" {
- pass "print value of (-3 > 4)"
- }
- -re ".*$gdb_prompt $" { fail "print value of (-3 > 4)" }
- timeout { fail "(timeout) print value of (-3 > 4)" }
- }
-
-
-send_gdb "print 3>=2.5\n"
-gdb_expect {
- -re ".\[0-9\]* = 1.*$gdb_prompt $" {
- pass "print value of 3>=2.5"
- }
- -re ".*$gdb_prompt $" { fail "print value of 3>=2.5" }
- timeout { fail "(timeout) print value of 3>=2.5" }
- }
-
-
-send_gdb "print 3>=4.5\n"
-gdb_expect {
- -re ".\[0-9\]* = 0.*$gdb_prompt $" {
- pass "print value of 3>=4.5"
- }
- -re ".*$gdb_prompt $" { fail "print value of 3>=4.5" }
- timeout { fail "(timeout) print value of 3>=4.5" }
- }
-
-
-send_gdb "print 3==3.0\n"
-gdb_expect {
- -re ".\[0-9\]* = 1.*$gdb_prompt $" {
- pass "print value of 3==3.0"
- }
- -re ".*$gdb_prompt $" { fail "print value of 3==3.0" }
- timeout { fail "(timeout) print value of 3==3.0" }
- }
-
-
-send_gdb "print 3==4.0\n"
-gdb_expect {
- -re ".\[0-9\]* = 0.*$gdb_prompt $" {
- pass "print value of 3==4.0"
- }
- -re ".*$gdb_prompt $" { fail "print value of 3==4.0" }
- timeout { fail "(timeout) print value of 3==4.0" }
- }
-
-
-send_gdb "print 3!=3.0\n"
-gdb_expect {
- -re ".\[0-9\]* = 0.*$gdb_prompt $" {
- pass "print value of 3!=3.0"
- }
- -re ".*$gdb_prompt $" { fail "print value of 3!=3.0" }
- timeout { fail "(timeout) print value of 3!=3.0" }
- }
-
-
-send_gdb "print 3!=5.0\n"
-gdb_expect {
- -re ".\[0-9\]* = 1.*$gdb_prompt $" {
- pass "print value of 3!=5.0"
- }
- -re ".*$gdb_prompt $" { fail "print value of 3!=5.0" }
- timeout { fail "(timeout) print value of 3!=5.0" }
- }
-
-
-send_gdb "print 0 || 1 && 0 | 0 ^ 0 == 8 > 128 >>1 +2 *2\n"
-gdb_expect {
- -re ".\[0-9\]* = 0.*$gdb_prompt $" {
- pass "print value of 0 || 1 && 0 | 0 ^ 0 == 8 > 128 >>1 +2 *2"
- }
- -re ".*$gdb_prompt $" { fail "print value of 0 || 1 && 0 | 0 ^ 0 == 8 > 128 >>1 +2 *2" }
- timeout { fail "(timeout) print value of 0 || 1 && 0 | 0 ^ 0 == 8 > 128 >>1 +2 *2" }
- }
-
-
-send_gdb "print 1.0 || 0\n"
-gdb_expect {
- -re ".\[0-9\]* = 1.*$gdb_prompt $" {
+gdb_test "print !1" ".\[0-9\]* = 0" "print value of !1"
+
+gdb_test "print !0" ".\[0-9\]* = 1" "print value of !0"
+
+gdb_test "print !100" ".\[0-9\]* = 0" "print value of !100"
+
+gdb_test "print !1000" ".\[0-9\]* = 0" "print value of !1000"
+
+gdb_test "print !10" ".\[0-9\]* = 0" "print value of !10"
+
+gdb_test "print !2" ".\[0-9\]* = 0" "print value of !2 "
+
+gdb_test "print 10 | 5" ".\[0-9\]* = 15" "print value of 10 | 5"
+
+gdb_test "print 10 & 5" ".\[0-9\]* = 0" "print value of 10 & 5"
+
+gdb_test "print 10 ^ 5" ".\[0-9\]* = 15" "print value of 10 ^ 5"
+
+gdb_test "print -!0" ".\[0-9\]* = -1" "print value of -!0"
+
+gdb_test "print ~-!0" ".\[0-9\]* = 0" "print value of ~-!0"
+
+gdb_test "print 3 * 2 / 4.0 * 2.0" ".\[0-9\]* = 3" \
+ "print value of 3 * 2 / 4.0 * 2.0"
+
+gdb_test "print 8 << 2 >> 4" ".\[0-9\]* = 2" \
+ "print value of 8 << 2 >> 4"
+
+gdb_test "print -1 < 0 > 1" ".\[0-9\]* = 0" \
+ "print value of -1 < 0 > 1"
+
+gdb_test "print 15 ^ 10 ^ 5 ^ 7" ".\[0-9\]* = 7" \
+ "print value of 15 ^ 10 ^ 5 ^ 7"
+
+gdb_test "print 3.5 < 4.0" ".\[0-9\]* = 1" \
+ "print value of 3.5 < 4.0"
+
+gdb_test "print 3.5 < -4.0" ".\[0-9\]* = 0" \
+ "print value of 3.5 < -4.0"
+
+gdb_test "print 2 > -3" ".\[0-9\]* = 1" "print value of 2 > -3"
+
+gdb_test "print -3>4" ".\[0-9\]* = 0" "print value of -3>4"
+
+gdb_test "print (-3 > 4)" ".\[0-9\]* = 0" "print value of (-3 > 4)"
+
+gdb_test "print 3>=2.5" ".\[0-9\]* = 1" "print value of 3>=2.5"
+
+gdb_test "print 3>=4.5" ".\[0-9\]* = 0" "print value of 3>=4.5"
+
+gdb_test "print 3==3.0" ".\[0-9\]* = 1" "print value of 3==3.0"
+
+gdb_test "print 3==4.0" ".\[0-9\]* = 0" "print value of 3==4.0"
+
+gdb_test "print 3!=3.0" ".\[0-9\]* = 0" "print value of 3!=3.0"
+
+gdb_test "print 3!=5.0" ".\[0-9\]* = 1" "print value of 3!=5.0"
+
+gdb_test "print 0 || 1 && 0 | 0 ^ 0 == 8 > 128 >>1 +2 *2" \
+ ".\[0-9\]* = 0" \
+ "print value of 0 || 1 && 0 | 0 ^ 0 == 8 > 128 >>1 +2 *2"
+
+gdb_test "print 1.0 || 0" ".\[0-9\]* = 1" \
pass "print value of 1.0 || 0"
- }
- -re ".*$gdb_prompt $" { fail "print value of 1.0 || 0" }
- timeout { fail "(timeout) print value of 1.0 || 0" }
- }
-
-
-send_gdb "print 0.0 || 1.0\n"
-gdb_expect {
- -re ".\[0-9\]* = 1.*$gdb_prompt $" {
- pass "print value of 0.0 || 1.0"
- }
- -re ".*$gdb_prompt $" { fail "print value of 0.0 || 1.0" }
- timeout { fail "(timeout) print value of 0.0 || 1.0" }
- }
-
-
-send_gdb "print 0.0 || 0\n"
-gdb_expect {
- -re ".\[0-9\]* = 0.*$gdb_prompt $" {
- pass "print value of 0.0 || 0"
- }
- -re ".*$gdb_prompt $" { fail "print value of 0.0 || 0" }
- timeout { fail "(timeout) print value of 0.0 || 0" }
- }
-
-
-send_gdb "print 0 || 1 && 0 | 0 ^ 0 == 8\n"
-gdb_expect {
- -re ".\[0-9\]* = 0.*$gdb_prompt $" {
- pass "print value of 0 || 1 && 0 | 0 ^ 0 == 8"
- }
- -re ".*$gdb_prompt $" { fail "print value of 0 || 1 && 0 | 0 ^ 0 == 8" }
- timeout { fail "(timeout) print value of 0 || 1 && 0 | 0 ^ 0 == 8" }
- }
-
-
-send_gdb "print 0 == 8 > 128 >> 1 + 2 * 2\n"
-gdb_expect {
- -re ".\[0-9\]* = 0.*$gdb_prompt $" {
- pass "print value of 0 == 8 > 128 >> 1 + 2 * 2"
- }
- -re ".*$gdb_prompt $" { fail "print value of 0 == 8 > 128 >> 1 + 2 * 2" }
- timeout { fail "(timeout) print value of 0 == 8 > 128 >> 1 + 2 * 2" }
- }
+
+gdb_test "print 0.0 || 1.0" ".\[0-9\]* = 1" \
+ "print value of 0.0 || 1.0"
+
+gdb_test "print 0.0 || 0" ".\[0-9\]* = 0" \
+ "print value of 0.0 || 0"
+
+gdb_test "print 0 || 1 && 0 | 0 ^ 0 == 8" ".\[0-9\]* = 0" \
+ "print value of 0 || 1 && 0 | 0 ^ 0 == 8"
+
+gdb_test "print 0 == 8 > 128 >> 1 + 2 * 2" ".\[0-9\]* = 0" \
+ "print value of 0 == 8 > 128 >> 1 + 2 * 2"