summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/formatted-ref.exp
diff options
context:
space:
mode:
authorJerome Guitton <guitton@adacore.com>2008-11-27 09:52:55 +0000
committerJerome Guitton <guitton@adacore.com>2008-11-27 09:52:55 +0000
commitc332165e457a1cf322b43f2c775636f3037b225d (patch)
tree9bf40ab1049a1aee92cfdf2d745602b4755fb8ac /gdb/testsuite/gdb.cp/formatted-ref.exp
parenta80b95ba67e2bcdda3a8437c23a8cab7fafd33db (diff)
downloadbinutils-gdb-c332165e457a1cf322b43f2c775636f3037b225d.tar.gz
* gdb.cp/formatted-ref.exp: Add equality test.
* gdb.ada/formatted_ref.exp: Ditto.
Diffstat (limited to 'gdb/testsuite/gdb.cp/formatted-ref.exp')
-rw-r--r--gdb/testsuite/gdb.cp/formatted-ref.exp10
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/formatted-ref.exp b/gdb/testsuite/gdb.cp/formatted-ref.exp
index f9c8ad3f841..391dfebf899 100644
--- a/gdb/testsuite/gdb.cp/formatted-ref.exp
+++ b/gdb/testsuite/gdb.cp/formatted-ref.exp
@@ -23,6 +23,9 @@
# rather than printing both that and the dereferenced value. We also
# check that the (non-standard) expression &(&x), where x is of type T&,
# yields an appropriate value.
+# This also tests that some other arithmetic operations on references
+# work properly: condition expression using a reference object as one of its
+# operand.
if $tracelevel then {
strace $tracelevel
@@ -106,6 +109,11 @@ proc test_p_x_ref_addr { var addr } {
return 0
}
+proc test_p_op1_equals_op2 {op1 op2} {
+ set test "print $op1 == $op2"
+ gdb_test $test "\\$\[0-9\]+ = true"
+}
+
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
@@ -128,3 +136,5 @@ test_p_x_addr "i" $i1_address
test_p_x_ref_addr "s" $s1_address
test_p_x_ref_addr "i" $i1_address
test_p_x_ref_addr "e" $e1_address
+
+test_p_op1_equals_op2 "s.x" "13"