xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/testsuite/gdb.base/c-linkage-name.exp (revision 73d56d5b0be8704e4f0a7e8221a2c7309572c9a1)
1# Copyright 2018-2019 Free Software Foundation, Inc.
2
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; either version 3 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
16# This file is part of the gdb testsuite.  It is intended to test that
17# gdb can correctly print arrays with indexes for each element of the
18# array.
19
20standard_testfile .c
21
22if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
23    untested "failed to compile"
24    return -1
25}
26
27clean_restart ${binfile}
28
29# Try to print MUNDANE, but using its linkage name.
30
31gdb_test "print symada__cS" \
32         " = {a = 100829103}" \
33         "print symada__cS before partial symtab expansion"
34
35# Force the symbols to be expanded for the unit that contains
36# our symada__cS symbol by, e.g. inserting a breakpoint on one
37# of the founction also provided by the same using.
38
39gdb_test "break main" \
40         "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal\\."
41
42# Try to print MUNDANE using its linkage name again, after partial
43# symtab expansion.
44
45gdb_test "print symada__cS" \
46         " = {a = 100829103}" \
47         "print symada__cS after partial symtab expansion"
48