diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-10-15 17:48:48 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-10-15 17:48:48 +0000 |
commit | 92163a10dcb34785a2fc74a05c3e890fbe700731 (patch) | |
tree | e04e76f254a3faa4ebe963a9ecf8fbea39969ba9 /gdb/testsuite | |
parent | 3917d5d5ca1bed255ee9bd0a0b38360505ce5b4c (diff) | |
download | gdb-92163a10dcb34785a2fc74a05c3e890fbe700731.zip gdb-92163a10dcb34785a2fc74a05c3e890fbe700731.tar.gz gdb-92163a10dcb34785a2fc74a05c3e890fbe700731.tar.bz2 |
gdb/
PR exp/12117
* gdbtypes.c (check_typedef): Clean up function comment.
Keep track of instance flags as we strip typedefs and create a new
type to preserve them if necessary.
* gdbtypes.h (type) <instance_flags>: Extend the comment.
gdb/testsuite/
PR exp/12117
* gdb.cp/ptype-cv-cp.cc: New file.
* gdb.cp/ptype-cv-cp.exp: New file.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/ptype-cv-cp.cc | 34 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/ptype-cv-cp.exp | 41 |
3 files changed, 82 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 7e3f170..442a65a 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2010-10-13 Doug Evans <dje@google.com> + Jan Kratochvil <jan.kratochvil@redhat.com> + + PR exp/12117 + * gdb.cp/ptype-cv-cp.cc: New file. + * gdb.cp/ptype-cv-cp.exp: New file. + 2010-10-14 Sami Wagiaalla <swagiaal@redhat.com> * gdb.cp/converts.cc: New test program. diff --git a/gdb/testsuite/gdb.cp/ptype-cv-cp.cc b/gdb/testsuite/gdb.cp/ptype-cv-cp.cc new file mode 100644 index 0000000..560a7db --- /dev/null +++ b/gdb/testsuite/gdb.cp/ptype-cv-cp.cc @@ -0,0 +1,34 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2010 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/>. */ + +typedef int my_int; +typedef const my_int const_my_int; +typedef volatile my_int volatile_my_int; +typedef volatile const_my_int volatile_const_my_int; +typedef const volatile_my_int const_volatile_my_int; + +my_int v_my_int (0); +const_my_int v_const_my_int (1); +volatile_my_int v_volatile_my_int (2); +const_volatile_my_int v_const_volatile_my_int (3); +volatile_const_my_int v_volatile_const_my_int (4); + +int +main () +{ + return 0; +} diff --git a/gdb/testsuite/gdb.cp/ptype-cv-cp.exp b/gdb/testsuite/gdb.cp/ptype-cv-cp.exp new file mode 100644 index 0000000..c1926d9 --- /dev/null +++ b/gdb/testsuite/gdb.cp/ptype-cv-cp.exp @@ -0,0 +1,41 @@ +# Copyright 2010 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/>. + +# This file is part of the gdb testsuite. + +if { [skip_cplus_tests] } { continue } + +set testfile "ptype-cv-cp" +set srcfile ${testfile}.cc + +if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug c++}] } { + return -1 +} + +gdb_test "whatis v_my_int" "type = my_int" +gdb_test "ptype v_my_int" "type = int" + +gdb_test "whatis v_const_my_int" "type = const_my_int" +gdb_test "ptype v_const_my_int" "type = const int" + +gdb_test "whatis v_volatile_my_int" "type = volatile_my_int" +gdb_test "ptype v_volatile_my_int" "type = volatile int" + +gdb_test "whatis v_const_volatile_my_int" "type = const_volatile_my_int" +gdb_test "ptype v_const_volatile_my_int" "type = const volatile int" + +gdb_test "whatis v_volatile_const_my_int" "type = volatile_const_my_int" +setup_kfail "gcc/45997" *-*-* +gdb_test "ptype v_volatile_const_my_int" "type = const volatile int" |