Add translations for various sub-directories
[binutils-gdb.git] / gdb / testsuite / gdb.cp / ref-params.exp
blobe5c28e6e2ad38ecd0be78fb8cf1bfbc47a79cc01
1 # Tests for reference parameters of types and their subtypes in GDB.
2 # Copyright 2006-2024 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 # written by Paul N. Hilfinger (Hilfinger@adacore.com)
20 # test running programs
23 require allow_cplus_tests
25 standard_testfile .cc
27 if {[build_executable $testfile.exp $testfile $srcfile {debug c++}] == -1} {
28     return -1
31 proc gdb_start_again { text } {
32     global binfile
33     global srcfile
35     clean_restart $binfile
37     runto ${srcfile}:[gdb_get_line_number $text]
40 gdb_start_again "marker1 here"
41 gdb_test "print Q" ".*id = 42.*" "print value of a Child in main"
42 gdb_test "print f1(Q)" ".* = 42.*" "print value of f1 on Child in main"
43 gdb_test "print f2(Q)" ".* = 42.*" "print value of f2 on Child in main"
45 gdb_start_again "marker1 here"
46 gdb_test "print f1(QR)" ".* = 42.*" "print value of f1 on (Child&) in main"
48 gdb_start_again "marker1 here"
49 gdb_test "print f2(QR)" ".* = 42.*" "print value of f2 on (Child&) in main"
51 gdb_start_again "marker2 here"
52 gdb_test "print C" ".*id = 42.*" "print value of Child& in f2"
53 gdb_test "print f1(C)" ".* = 42.*" "print value of f1 on Child& in f2"
55 gdb_start_again "marker3 here"
56 gdb_test "print R" ".*id = 42.*" "print value of Parent& in f1"
58 gdb_start_again "breakpoint MQ here"
59 gdb_test "print f1(MQ)" ".* = 53"
60 gdb_test "print mf1(MQ)" ".* = 106"
61 gdb_test "print mf2(MQ)" ".* = 106"
62 gdb_test "print f1(MQR)" ".* = 53"
63 gdb_test "print mf1(MQR)" ".* = 106"
64 gdb_test "print mf2(MQR)" ".* = 106"
65 gdb_test "print f3(Q.id)" ".* = 42"