1226586Sdim# Copyright 2010-2020 Free Software Foundation, Inc.
2226586Sdim
3226586Sdim# This program is free software; you can redistribute it and/or modify
4226586Sdim# it under the terms of the GNU General Public License as published by
5226586Sdim# the Free Software Foundation; either version 3 of the License, or
6226586Sdim# (at your option) any later version.
7226586Sdim#
8226586Sdim# This program is distributed in the hope that it will be useful,
9226586Sdim# but WITHOUT ANY WARRANTY; without even the implied warranty of
10226586Sdim# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11226586Sdim# GNU General Public License for more details.
12226586Sdim#
13226586Sdim# You should have received a copy of the GNU General Public License
14239462Sdim# along with this program.  If not, see <http://www.gnu.org/licenses/>.
15243830Sdim
16226586Sdim# This file is part of the gdb testsuite
17239462Sdim
18226586Sdimset nl		"\[\r\n\]+"
19226586Sdim
20226586Sdimif { [skip_cplus_tests] } { continue }
21226586Sdim
22226586Sdimload_lib "cp-support.exp"
23226586Sdim
24226586Sdimstandard_testfile pr10728-x.cc pr10728-y.cc
25226586Sdimset tfx [standard_output_file pr10728-x.o]
26226586Sdimset tfy [standard_output_file pr10728-y.o]
27226586Sdim
28226586Sdimif  { [gdb_compile "${srcdir}/${subdir}/$srcfile2" "${tfy}.o" object {c++}] != "" } {
29226586Sdim     untested "failed to compile second object file"
30226586Sdim     return -1
31226586Sdim}
32243830Sdim
33226586Sdimif  { [gdb_compile "${srcdir}/${subdir}/$srcfile" "${tfx}.o" object {debug c++}] != "" } {
34226586Sdim     untested "failed to compile first object file"
35226586Sdim     return -1
36226586Sdim}
37226586Sdim
38226586Sdimif  { [gdb_compile "${tfx}.o ${tfy}.o" ${binfile} executable {debug c++}] != "" } {
39226586Sdim     untested "failed to compile"
40226586Sdim     return -1
41226586Sdim}
42226586Sdim
43226586Sdimclean_restart $binfile
44226586Sdim
45226586Sdimif ![runto_main] then {
46243830Sdim    perror "couldn't run to breakpoint"
47226586Sdim    continue
48226586Sdim}
49226586Sdim
50226586Sdim# set a breakpoint at the return stmt
51226586Sdim
52226586Sdimgdb_breakpoint [gdb_get_line_number "marker 1"]
53226586Sdimgdb_continue_to_breakpoint "marker 1"
54226586Sdim
55226586Sdimgdb_test "print x->y2 - x->y1" "warning: Type size unknown, assuming 1\. Try casting to a known type, or void \*\.\[^=\]*= 1"
56226586Sdim
57226586Sdimgdb_exit
58226586Sdimreturn 0
59226586Sdim
60226586Sdim
61226586Sdim