[gdbserver] Move malloc.h include to server.h.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / nsrecurs.exp
CommitLineData
b14e635e
SW
1# Copyright 2008 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
b14e635e
SW
16if $tracelevel then {
17 strace $tracelevel
18}
19
b14e635e
SW
20
21set testfile nsrecurs
22set srcfile ${testfile}.cc
23set binfile ${objdir}/${subdir}/${testfile}
df83a9bf
SW
24if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" \
25 "${binfile}" executable {debug c++}] != "" } {
b14e635e
SW
26 untested "Couldn't compile test program"
27 return -1
28}
29
30if [get_compiler_info ${binfile}] {
31 return -1
32}
33
34
35# Get things started.
36
37gdb_exit
38gdb_start
39gdb_reinitialize_dir $srcdir/$subdir
40gdb_load ${binfile}
41
42if ![runto_main] then {
43 perror "couldn't run to breakpoint main"
44 continue
45}
46
47############################################
48# test printing from namespace imported into
49# imported namespace
50
51gdb_test "print ax" "= 9"
52
53############################################
54# test that gdb can print without falling
55# into search loop
56
57gdb_test "print dx" "= 99"
58
59############################################
60# test printing from namespace imported into
61# imported namespace where imports are implicit
62# anonymous namespace imports.
63
64gdb_test "print xx" "= 999"
df83a9bf
SW
65
66############################################
67# Test printing using recursive namespace
68# aliases.
69
70setup_kfail "gdb/10541" "*-*-*"
71gdb_test "ptype G::GF" "= namespace F"
72
73setup_kfail "gdb/10541" "*-*-*"
74gdb_test "print G::GF::FE::ex" "= 9999"
This page took 0.098365 seconds and 4 git commands to generate.