Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(415)

Side by Side Diff: gdb/testsuite/gdb.cp/typeid.exp

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gdb/testsuite/gdb.cp/typeid.cc ('k') | gdb/testsuite/gdb.cp/userdef.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2013 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 standard_testfile .cc
17
18 if {[skip_cplus_tests]} {
19 return -1
20 }
21
22 if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
23 return -1
24 }
25
26 proc do_typeid_tests {started} {
27 global hex
28
29 # We might see the standard type or gdb's internal type.
30 set type_re "(std::type_info|struct gdb_gnu_v3_type_info)"
31
32
33 foreach simple_var {i cp ccp ca b} {
34 gdb_test "print &typeid($simple_var)" \
35 " = \\($type_re \\*\\) $hex.*"
36
37 # Note that we test pointer equality rather than object
38 # equality here. That is because std::type_info's operator==
39 # is not present in the libstdc++ .so.
40 gdb_test "print &typeid($simple_var) == &typeid(typeof($simple_var))" \
41 " = true"
42 }
43
44 # typeid for these is Derived. Don't try these tests until the
45 # inferior has started.
46 if {$started} {
47 foreach der_var {*b *vb1 *vb2 *bv d {const Derived} {const Derived &}} {
48 gdb_test "print &typeid($der_var)" \
49 " = \\($type_re \\*\\) $hex.*"
50 gdb_test "print &typeid($der_var) == &typeid(d)" \
51 " = true"
52 }
53 }
54 }
55
56 with_test_prefix "before starting" {
57 do_typeid_tests 0
58 }
59
60 if ![runto_main] {
61 untested typeid
62 return -1
63 }
64
65 with_test_prefix "after starting" {
66 do_typeid_tests 1
67 }
OLDNEW
« no previous file with comments | « gdb/testsuite/gdb.cp/typeid.cc ('k') | gdb/testsuite/gdb.cp/userdef.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698