diff options
author | Daniel Jacobowitz <drow@false.org> | 2002-02-18 18:57:07 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2002-02-18 18:57:07 +0000 |
commit | fb8acdcc53c8a2a4f2399f64c0d768a4cddae011 (patch) | |
tree | ea9a17935b9d500c104c1629a4369ba557eed3ff | |
parent | 0d3a9f4892df5f572bdbb035803be27d935a0507 (diff) | |
download | gdb-fb8acdcc53c8a2a4f2399f64c0d768a4cddae011.zip gdb-fb8acdcc53c8a2a4f2399f64c0d768a4cddae011.tar.gz gdb-fb8acdcc53c8a2a4f2399f64c0d768a4cddae011.tar.bz2 |
2002-02-18 Daniel Jacobowitz <drow@mvista.com>
* gdb.c++/userdef.exp: Test overloaded operators properly.
Remove xfails.
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.c++/userdef.exp | 331 |
2 files changed, 63 insertions, 273 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 1696678..afd11d8 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2002-02-18 Daniel Jacobowitz <drow@mvista.com> + + * gdb.c++/userdef.exp: Test overloaded operators properly. + Remove xfails. + 2002-02-14 Daniel Jacobowitz <drow@mvista.com> * gdb.base/a2-run.exp: Check for a remote target properly. diff --git a/gdb/testsuite/gdb.c++/userdef.exp b/gdb/testsuite/gdb.c++/userdef.exp index 8e3d642..df18e4a 100644 --- a/gdb/testsuite/gdb.c++/userdef.exp +++ b/gdb/testsuite/gdb.c++/userdef.exp @@ -64,279 +64,64 @@ send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $" } -setup_xfail "hppa*-*-*" -send_gdb "print one+two\n" -gdb_expect { - -re "FIXME.*$gdb_prompt $" { - pass "print value of one + two" - } - -re ".*$gdb_prompt $" { xfail "print value of one two" } - timeout { fail "(timeout) print value of one two" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print one-two\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of one - two" - } - -re ".*$gdb_prompt $" { xfail "print value of one - two" } - timeout { fail "(timeout) print value of one - two" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print one*two\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of one * two" - } - -re ".*$gdb_prompt $" { xfail "print value of one * two" } - timeout { fail "(timeout) print value of one * two" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print one/two\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of one / two" - } - -re ".*$gdb_prompt $" { xfail "print value of one / two" } - timeout { fail "(timeout) print value of one / two" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print one%two\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of one % two" - } - -re ".*$gdb_prompt $" { xfail "print value of one % two" } - timeout { fail "(timeout) print value of one % two" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print one&&two\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of one && two" - } - -re ".*$gdb_prompt $" { xfail "print value of one && two" } - timeout { fail "(timeout) print value of one && two" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print one||two\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of one|| two" - } - -re ".*$gdb_prompt $" { xfail "print value of one|| two" } - timeout { fail "(timeout) print value of one|| two" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print one&two\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of one & two" - } - -re ".*$gdb_prompt $" { xfail "print value of one & two" } - timeout { fail "(timeout) print value of one & two" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print one|two\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of one | two" - } - -re ".*$gdb_prompt $" { xfail "print value of one | two" } - timeout { fail "(timeout) print value of one | two" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print one ^ two\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of one ^ two" - } - -re ".*$gdb_prompt $" { xfail "print value of one ^ two" } - timeout { fail "(timeout) print value of one ^ two" } - } - - -setup_xfail "hppa*-*-*" -send_gdb "print one < two\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of one < two" - } - -re ".*$gdb_prompt $" { xfail "print value of one < two" } - timeout { fail "(timeout) print value of one < two" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print one <= two\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of one <= two" - } - -re ".*$gdb_prompt $" { xfail "print value of one <= two" } - timeout { fail "(timeout) print value of one <= two" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print one > two\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of one > two" - } - -re ".*$gdb_prompt $" { xfail "print value of one > two" } - timeout { fail "(timeout) print value of one > two" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print one >= two\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of one >= two" - } - -re ".*$gdb_prompt $" { xfail "print value of one >= two" } - timeout { fail "(timeout) print value of one >= two" } - } - - -setup_xfail "hppa*-*-*" -send_gdb "print one==two\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of one == two" - } - -re ".*$gdb_prompt $" { xfail "print value of one == two" } - timeout { fail "(timeout) print value of one == two" } - } - - -setup_xfail "hppa*-*-*" -send_gdb "print one!=two\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of one != two" - } - -re ".*$gdb_prompt $" { xfail "print value of one != two" } - timeout { fail "(timeout) print value of one != two" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print one<<31\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of one<<31" - } - -re ".*$gdb_prompt $" { xfail "print value of one<<31" } - timeout { fail "(timeout) print value of one<<31" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print one>>31\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of one>>31" - } - -re ".*$gdb_prompt $" { xfail "print value of one>>31" } - timeout { fail "(timeout) print value of one>>31" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print !one\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of !one" - } - -re ".*$gdb_prompt $" { xfail "print value of !one" } - timeout { fail "(timeout) print value of !one" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print ~one\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of ~one" - } - -re ".*$gdb_prompt $" { xfail "print value of ~one" } - timeout { fail "(timeout) print value of ~one" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print -one\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of -one" - } - -re ".*$gdb_prompt $" { xfail "print value of -one" } - timeout { fail "(timeout) print value of -one" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print one++\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of one++" - } - -re ".*$gdb_prompt $" { xfail "print value of one++" } - timeout { fail "(timeout) print value of one++" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print ++one\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of ++one>>31" - } - -re ".*$gdb_prompt $" { xfail "print value of ++one" } - timeout { fail "(timeout) print value of ++one" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print one--\n" -gdb_expect { - -re ".*.FIXME*$gdb_prompt $" { - pass "print value of one-->>31" - } - -re ".*$gdb_prompt $" { xfail "print value of one-->>31" } - timeout { fail "(timeout) print value of one-->>31" } - } - - -setup_xfail "hppa*-*-*" -send_gdb "print --one\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of --one" - } - -re ".*$gdb_prompt $" { xfail "print value of --one" } - timeout { fail "(timeout) print value of --one" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print one+=7\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of one+=7" - } - -re ".*$gdb_prompt $" { xfail "print value of one+=7" } - timeout { fail "(timeout) print value of one+=7" } - } - -setup_xfail "hppa*-*-*" -send_gdb "print two=one\n" -gdb_expect { - -re ".*FIXME.*$gdb_prompt $" { - pass "print value of two=one" - } - -re ".*$gdb_prompt $" { xfail "print value of two=one" } - timeout { fail "(timeout) print value of two=one" } - } +gdb_test "print one + two" "\\\$\[0-9\]* = {x = 6, y = 8}" + +gdb_test "print one - two" "\\\$\[0-9\]* = {x = -2, y = -2}" + +gdb_test "print one * two" "\\\$\[0-9\]* = {x = 8, y = 15}" + +gdb_test "print one / two" "\\\$\[0-9\]* = {x = 0, y = 0}" + +gdb_test "print one % two" "\\\$\[0-9\]* = {x = 2, y = 3}" + +gdb_test "print one && two" "\\\$\[0-9\]* = 1\[\r\n\]" + +gdb_test "print one || two" "\\\$\[0-9\]* = 1\[\r\n\]" + +gdb_test "print one & two" "\\\$\[0-9\]* = {x = 0, y = 1}" + +gdb_test "print one | two" "\\\$\[0-9\]* = {x = 6, y = 7}" + +gdb_test "print one ^ two" "\\\$\[0-9\]* = {x = 6, y = 6}" + +gdb_test "print one < two" "\\\$\[0-9\]* = 1\[\r\n\]" + +gdb_test "print one <= two" "\\\$\[0-9\]* = 1\[\r\n\]" + +gdb_test "print one > two" "\\\$\[0-9\]* = 0\[\r\n\]" + +gdb_test "print one >= two" "\\\$\[0-9\]* = 0\[\r\n\]" + +gdb_test "print one == two" "\\\$\[0-9\]* = 0\[\r\n\]" + +gdb_test "print one != two" "\\\$\[0-9\]* = 1\[\r\n\]" + +# Can't really check the output of this one without knowing +# target integer width. Make sure we don't try to call +# the iostreams operator instead, though. +gdb_test "print one << 31" "\\\$\[0-9\]* = {x = -?\[0-9\]*, y = -?\[0-9\]*}" + +# Should be fine even on < 32-bit targets. +gdb_test "print one >> 31" "\\\$\[0-9\]* = {x = 0, y = 0}" + +gdb_test "print !one" "\\\$\[0-9\]* = 0\[\r\n\]" + +# Assumes 2's complement. So does everything... +gdb_test "print ~one" "\\\$\[0-9\]* = {x = -3, y = -4}" + +gdb_test "print -one" "\\\$\[0-9\]* = {x = -2, y = -3}" + +gdb_test "print one++" "\\\$\[0-9\]* = {x = 2, y = 4}" + +gdb_test "print ++one" "\\\$\[0-9\]* = {x = 3, y = 4}" + +gdb_test "print one--" "\\\$\[0-9\]* = {x = 3, y = 3}" + +gdb_test "print --one" "\\\$\[0-9\]* = {x = 2, y = 3}" + +gdb_test "print one += 7" "\\\$\[0-9\]* = {x = 9, y = 10}" + +gdb_test "print two = one" "\\\$\[0-9\]* = {x = 9, y = 10}" # Check that GDB tolerates whitespace in operator names. gdb_test "break A1::'operator+'" ".*Breakpoint $decimal at.*" |