From 92163a10dcb34785a2fc74a05c3e890fbe700731 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 15 Oct 2010 17:48:48 +0000 Subject: 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) : Extend the comment. gdb/testsuite/ PR exp/12117 * gdb.cp/ptype-cv-cp.cc: New file. * gdb.cp/ptype-cv-cp.exp: New file. --- gdb/testsuite/ChangeLog | 7 ++++++ gdb/testsuite/gdb.cp/ptype-cv-cp.cc | 34 ++++++++++++++++++++++++++++++ gdb/testsuite/gdb.cp/ptype-cv-cp.exp | 41 ++++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 gdb/testsuite/gdb.cp/ptype-cv-cp.cc create mode 100644 gdb/testsuite/gdb.cp/ptype-cv-cp.exp (limited to 'gdb/testsuite') 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 + Jan Kratochvil + + PR exp/12117 + * gdb.cp/ptype-cv-cp.cc: New file. + * gdb.cp/ptype-cv-cp.exp: New file. + 2010-10-14 Sami Wagiaalla * 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 . */ + +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 . + +# 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" -- cgit v1.1