* gdb.ada/formatted_ref.exp: Ditto.
+2008-11-27 Jerome Guitton <guitton@adacore.com>
+
+ * gdb.cp/formatted-ref.exp: Add equality test.
+ * gdb.ada/formatted_ref.exp: Ditto.
+
2008-11-25 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/breakpoint-shadow.exp, gdb.base/breakpoint-shadow.c: New.
# tests because only a few parameter types in Ada are required to be
# passed by reference, and there is no equivalent of &(&x) for reference
# values.
+# 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
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
test_p_x "s" "(x => 0xd, y => 0x13)" $s1_address
test_p_x_addr "s" $s1_address
+
+test_p_op1_equals_op2 "s.x" "13"
# 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
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
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"