Switch the license of all .exp files to GPLv3.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / whatis.exp
index 20cd67e287d8e04efc481da62966aec6df33de00..d9abfc1037584ab674f37a19f5da46c8850a4dfe 100644 (file)
@@ -1,21 +1,18 @@
-#   Copyright (C) 1988, 1990, 1991, 1992, 1995, 1997 Free Software Foundation, Inc.
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1999, 2002, 2003,
+# 2004, 2007 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 2 of the License, or
+# 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, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This file was written by Rob Savoye. (rob@cygnus.com)
 
@@ -33,7 +30,8 @@ set testfile whatis
 set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+     untested whatis.exp
+     return -1
 }
 
 # Create and source the file that provides information about the compiler
@@ -74,20 +72,9 @@ gdb_test "whatis v_char" \
     "type = (unsigned char|char)" \
     "whatis char"
 
-# If we did not use the signed keyword when compiling the file, don't
-# expect GDB to know that char is signed.
-if { $hp_cc_compiler || $hp_aCC_compiler } {
-    set signed_keyword_not_used 1
-}
-if $signed_keyword_not_used then {
-    set signed_char "char"
-} else {
-    set signed_char "signed char"
-}
-setup_xfail "a29k-*-*"
 if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix*" }
 gdb_test "whatis v_signed_char" \
-    "type = $signed_char" \
+    "type = (signed char|char)" \
     "whatis signed char"
 
 gdb_test "whatis v_unsigned_char" \
@@ -286,6 +273,10 @@ gdb_test "whatis v_struct1" \
     "type = struct t_struct" \
     "whatis named structure"
 
+gdb_test "whatis struct t_struct" \
+    "type = struct t_struct" \
+    "whatis named structure using type name"
+
 gdb_test "whatis v_struct2" \
     "type = struct \{$unstruct\}" \
     "whatis unnamed structure"
@@ -296,20 +287,22 @@ gdb_test "whatis v_union" \
     "type = union t_union" \
     "whatis named union"
 
+gdb_test "whatis union t_union" \
+    "type = union t_union" \
+    "whatis named union using type name"
+
 gdb_test "whatis v_union2" \
     "type = union \{$ununion\}" \
     "whatis unnamed union"
 
 
-if { [istarget "hppa*-hp-hpux*"] && $hp_aCC_compiler } {
-    # HP-UX: HP aCC compiler w/ +objdebug option detects language as
-    # c++, so we need the 'void' pattern here.
-    # Without +objdebug compilation option we still need to match ''.
-    # - guo
-    set void "(void|)"
-} else {
-    set void ""
-}
+# HP-UX: HP aCC compiler w/ +objdebug option detects language as
+# c++, so we need the 'void' pattern here.
+# Without +objdebug compilation option we still need to match ''.
+# - guo
+# Also, using stabs we will mark these functions as prototyped.  This
+# is harmless but causes an extra VOID to be printed.
+set void "(void|)"
 
 # test whatis command with functions return type
 gdb_test "whatis v_char_func" \
@@ -386,6 +379,10 @@ gdb_test "whatis clunker" \
     "type = enum cars" \
     "whatis enumeration"
 
+gdb_test "whatis enum cars" \
+    "type = enum cars" \
+    "whatis enumeration using type name"
+
 
 # test whatis command with nested struct and union
 gdb_test "whatis nested_su" \
@@ -417,3 +414,13 @@ gdb_test "whatis nested_su.inner_union_instance" \
 gdb_test "whatis nested_su.inner_union_instance.inner_union_int" \
     "type = int" \
     "whatis inner union member"
+
+# test whatis command with typedefs
+
+gdb_test "whatis char_addr" \
+    "type = char \\*" \
+    "whatis using typedef type name"
+
+gdb_test "whatis a_char_addr" \
+    "type = char_addr" \
+    "whatis applied to variable defined by typedef"
This page took 0.029723 seconds and 4 git commands to generate.