diff options
Diffstat (limited to 'gdb/testsuite/gdb.base/bitops.exp')
-rw-r--r-- | gdb/testsuite/gdb.base/bitops.exp | 393 |
1 files changed, 75 insertions, 318 deletions
diff --git a/gdb/testsuite/gdb.base/bitops.exp b/gdb/testsuite/gdb.base/bitops.exp index 634d4a67b0f..12c8f3b60bc 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" |