Update copyright year range in all GDB files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / subtypes.exp
1 # Copyright 2018-2020 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 # Test for subtype definitions, i.e., types defined in classes, functions,
17 # etc.
18
19 if {[skip_cplus_tests]} { continue }
20
21 load_lib "cp-support.exp"
22
23 standard_testfile .cc subtypes-2.cc
24
25 if {[prepare_for_testing "failed to prepare" $testfile \
26 [list $srcfile $srcfile2] \
27 {debug c++ additional_flags=-std=c++11}]} {
28 return -1
29 }
30
31 gdb_test "ptype Outer::Inner::InnerInner" \
32 "type = struct Outer::Inner::InnerInner.*"
33 gdb_test "ptype Outer::Inner" "type = struct Outer::Inner.*"
34 gdb_test "ptype main::Foo" "type = struct Foo.*"
35 gdb_test "ptype main::Bar" "type = struct Bar.*"
36 gdb_test "ptype main::Baz" "type = struct Baz.*"
37 gdb_test "ptype Outer::Oenum" "type = enum class Outer::Oenum.*"
38 gdb_test "ptype foobar<int>::Foo" "type = struct Foo.*"
39 gdb_test "ptype foobar<int>::Bar" "type = struct Bar.*"
40 gdb_test "ptype foobar<int>::Baz" "type = struct Baz.*"
41 gdb_test "ptype foobar<char>::Foo" "type = struct Foo.*"
42 gdb_test "ptype foobar<char>::Bar" "type = struct Bar.*"
43 gdb_test "ptype foobar<char>::Baz" "type = struct Baz.*"
44 gdb_breakpoint "Outer::Inner::doit" message
45 gdb_breakpoint "main::Foo::doit" message
46 gdb_breakpoint "main::Bar::doit" message
47 gdb_breakpoint "main::Baz::doit" message
48 gdb_breakpoint "foobar<int>(int)::Foo::doit" message
49 gdb_breakpoint "foobar<int>(int)::Bar::doit" message
50 gdb_breakpoint "foobar<int>(int)::Baz::doit" message
51 gdb_breakpoint "foobar<char>(int)::Foo::doit" message
52 gdb_breakpoint "foobar<char>(int)::Bar::doit" message
53 gdb_breakpoint "foobar<char>(int)::Baz::doit" message
This page took 0.030196 seconds and 4 git commands to generate.