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

Unified Diff: gdb/testsuite/gdb.cp/m-static.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/testsuite/gdb.cp/m-static.cc ('k') | gdb/testsuite/gdb.cp/maint.exp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/testsuite/gdb.cp/m-static.exp
diff --git a/gdb/testsuite/gdb.cp/m-static.exp b/gdb/testsuite/gdb.cp/m-static.exp
index 0ac1d2eb0b7aa3e42bfe319bd3f0a5d1562e53c7..a5d388c804e45ee6fe556a90ee78af6fed9f3535 100644
--- a/gdb/testsuite/gdb.cp/m-static.exp
+++ b/gdb/testsuite/gdb.cp/m-static.exp
@@ -1,4 +1,4 @@
-# Copyright 2002, 2004, 2007-2012 Free Software Foundation, Inc.
+# Copyright 2002-2013 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
@@ -52,6 +52,11 @@ gdb_continue_to_breakpoint "end of constructors"
# One.
+# simple object, static const int, accessing via 'class::method::variable'
+# Regression test for PR c++/15203 and PR c++/15210
+gdb_test "print 'gnu_obj_1::method()::sintvar'" "\\$\[0-9\]+ = 4" \
+ "simple object, static const int, accessing via 'class::method::variable"
+
# simple object, static const bool
gdb_test "print test1.test" "\\$\[0-9\]* = true" "simple object, static const bool"
@@ -64,6 +69,58 @@ gdb_test "print test1.key2" "\\$\[0-9\]* = 77" "simple object, static long"
# simple object, static enum
gdb_test "print test1.value" "\\$\[0-9\]* = oriental" "simple object, static enum"
+if { [istarget arm*-*-*] } {
+ gdb_test "print test5.single_constructor" \
+ { = {single_constructor \*\(single_constructor \* const\)} 0x[0-9a-f]+ <single_constructor::single_constructor\(\)>} \
+ "simple object instance, print constructor"
+ gdb_test "ptype test5.single_constructor" \
+ {type = class single_constructor {\r\n public:\r\n single_constructor\(void\);\r\n ~single_constructor\(int\);\r\n} \*\(single_constructor \* const\)} \
+ "simple object instance, ptype constructor"
+ gdb_test "ptype single_constructor::single_constructor" \
+ {type = class single_constructor {\r\n public:\r\n single_constructor\(void\);\r\n ~single_constructor\(int\);\r\n} \*\(single_constructor \* const\)} \
+ "simple object class, ptype constructor"
+
+ gdb_test "print test1.~gnu_obj_1" \
+ { = {void \*\(gnu_obj_1 \* const, int\)} 0x[0-9a-f]+ <gnu_obj_1::~gnu_obj_1\(\)>} \
+ "simple object instance, print destructor"
+ gdb_test "ptype test1.~gnu_obj_1" \
+ {type = void \*\(gnu_obj_1 \* const, int\)} \
+ "simple object instance, ptype destructor"
+
+ gdb_test "print test1.'~gnu_obj_1'" \
+ { = {void \*\(gnu_obj_1 \*( const)?, int\)} 0x[0-9a-f]+ <gnu_obj_1::~gnu_obj_1\(\)>} \
+ "simple object instance, print quoted destructor"
+
+ gdb_test "ptype gnu_obj_1::'~gnu_obj_1'" \
+ {type = void \*\(gnu_obj_1 \* const\)} \
+ "simple object class, ptype quoted destructor"
+} else {
+ gdb_test "print test5.single_constructor" \
+ { = {void \(single_constructor \* const\)} 0x[0-9a-f]+ <single_constructor::single_constructor\(\)>} \
+ "simple object instance, print constructor"
+ gdb_test "ptype test5.single_constructor" \
+ {type = void \(single_constructor \* const\)} \
+ "simple object instance, ptype constructor"
+ gdb_test "ptype single_constructor::single_constructor" \
+ {type = void \(single_constructor \* const\)} \
+ "simple object class, ptype constructor"
+
+ gdb_test "print test1.~gnu_obj_1" \
+ { = {void \(gnu_obj_1 \* const, int\)} 0x[0-9a-f]+ <gnu_obj_1::~gnu_obj_1\(\)>} \
+ "simple object instance, print destructor"
+ gdb_test "ptype test1.~gnu_obj_1" \
+ {type = void \(gnu_obj_1 \* const, int\)} \
+ "simple object instance, ptype destructor"
+
+ gdb_test "print test1.'~gnu_obj_1'" \
+ { = {void \(gnu_obj_1 \*( const)?, int\)} 0x[0-9a-f]+ <gnu_obj_1::~gnu_obj_1\(\)>} \
+ "simple object instance, print quoted destructor"
+
+ gdb_test "ptype gnu_obj_1::'~gnu_obj_1'" \
+ {type = void \(gnu_obj_1 \* const\)} \
+ "simple object class, ptype quoted destructor"
+}
+
# Two.
# derived template object, base static const bool
@@ -112,7 +169,10 @@ if {[test_compiler_info {gcc-[0-3]-*}]
# and DW_AT_MIPS_linkage_name = _ZN9gnu_obj_47nowhereE .
setup_xfail *-*-*
}
-gdb_test "print test4.nowhere" "field nowhere is nonexistent or has been optimized out" "static const int initialized nowhere"
+gdb_test "print test4.nowhere" "<optimized out>" "static const int initialized nowhere (print field)"
+
+# Same, but print the whole struct.
+gdb_test "print test4" "static nowhere = <optimized out>.*" "static const int initialized nowhere (whole struct)"
# static const initialized in the class definition, PR gdb/11702.
if { $non_dwarf } { setup_xfail *-*-* }
« no previous file with comments | « gdb/testsuite/gdb.cp/m-static.cc ('k') | gdb/testsuite/gdb.cp/maint.exp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698