summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/subtypes.exp
blob: 6c5f7f845c5b3caefa62bc3dc3333a1c7f633153 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Copyright 2018 Free Software Foundation, Inc.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# Test for subtype definitions, i.e., types defined in classes, functions,
# etc.

if {[skip_cplus_tests]} { continue }

load_lib "cp-support.exp"

standard_testfile .cc subtypes-2.cc

if {[prepare_for_testing "failed to prepare" $testfile \
	 [list $srcfile $srcfile2] {debug c++}]} {
    return -1
}

gdb_test "ptype Outer::Inner::InnerInner" \
    "type = struct Outer::Inner::InnerInner.*"
gdb_test "ptype Outer::Inner" "type = struct Outer::Inner.*"
gdb_test "ptype main::Foo" "type = struct Foo.*"
gdb_test "ptype main::Bar" "type = struct Bar.*"
gdb_test "ptype main::Baz" "type = struct Baz.*"
gdb_test "ptype Outer::Oenum" "type = enum class Outer::Oenum.*"
gdb_test "ptype foobar<int>::Foo" "type = struct Foo.*"
gdb_test "ptype foobar<int>::Bar" "type = struct Bar.*"
gdb_test "ptype foobar<int>::Baz" "type = struct Baz.*"
gdb_test "ptype foobar<char>::Foo" "type = struct Foo.*"
gdb_test "ptype foobar<char>::Bar" "type = struct Bar.*"
gdb_test "ptype foobar<char>::Baz" "type = struct Baz.*"
gdb_breakpoint "Outer::Inner::doit" message
gdb_breakpoint "main::Foo::doit" message
gdb_breakpoint "main::Bar::doit" message
gdb_breakpoint "main::Baz::doit" message
gdb_breakpoint "foobar<int>(int)::Foo::doit" message
gdb_breakpoint "foobar<int>(int)::Bar::doit" message
gdb_breakpoint "foobar<int>(int)::Baz::doit" message
gdb_breakpoint "foobar<char>(int)::Foo::doit" message
gdb_breakpoint "foobar<char>(int)::Bar::doit" message
gdb_breakpoint "foobar<char>(int)::Baz::doit" message