From c332165e457a1cf322b43f2c775636f3037b225d Mon Sep 17 00:00:00 2001 From: Jerome Guitton Date: Thu, 27 Nov 2008 09:52:55 +0000 Subject: [PATCH] * gdb.cp/formatted-ref.exp: Add equality test. * gdb.ada/formatted_ref.exp: Ditto. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.ada/formatted_ref.exp | 10 ++++++++++ gdb/testsuite/gdb.cp/formatted-ref.exp | 10 ++++++++++ 3 files changed, 25 insertions(+) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 85e6a3bb250..ba11df1946c 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-11-27 Jerome Guitton + + * gdb.cp/formatted-ref.exp: Add equality test. + * gdb.ada/formatted_ref.exp: Ditto. + 2008-11-25 Jan Kratochvil * gdb.base/breakpoint-shadow.exp, gdb.base/breakpoint-shadow.c: New. diff --git a/gdb/testsuite/gdb.ada/formatted_ref.exp b/gdb/testsuite/gdb.ada/formatted_ref.exp index 4029aeb8b3c..206ed96c367 100644 --- a/gdb/testsuite/gdb.ada/formatted_ref.exp +++ b/gdb/testsuite/gdb.ada/formatted_ref.exp @@ -20,6 +20,9 @@ # 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 @@ -88,6 +91,11 @@ proc test_p_x_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 @@ -100,3 +108,5 @@ set s1_address [get_address "s1"] 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" 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" -- 2.30.2