]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.base/whatis.c
daily update
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / whatis.c
index 6d8d1e64bb5421796d2a0bb8589be4fc6dc49a36..4636aaffcaa3833f08f7d8462cced352cd173815 100644 (file)
@@ -1,3 +1,20 @@
+/* This test program is part of GDB, the GNU debugger.
+
+   Copyright 1992-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
+   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/>.  */
+
 /*
  *     Test file with lots of different types, for testing the
  *     "whatis" command.
@@ -7,10 +24,6 @@
  *     First the basic C types.
  */
 
-#if !(defined (__STDC__) || defined (_AIX))
-#define signed  /**/
-#endif
-
 char           v_char;
 signed char    v_signed_char;
 unsigned char  v_unsigned_char;
@@ -27,6 +40,12 @@ long         v_long;
 signed long    v_signed_long;
 unsigned long  v_unsigned_long;
 
+#ifndef NO_LONG_LONG
+long long              v_long_long;
+signed long long       v_signed_long_long;
+unsigned long long     v_unsigned_long_long;
+#endif
+
 float          v_float;
 double         v_double;
 
@@ -53,6 +72,12 @@ long         v_long_array[2];
 signed long    v_signed_long_array[2];
 unsigned long  v_unsigned_long_array[2];
 
+#ifndef NO_LONG_LONG
+long long              v_long_long_array[2];
+signed long long       v_signed_long_long_array[2];
+unsigned long long     v_unsigned_long_long_array[2];
+#endif
+
 float          v_float_array[2];
 double         v_double_array[2];
 
@@ -63,8 +88,15 @@ double               v_double_array[2];
    a special case kludge in GDB (Unix system include files like to define
    caddr_t), but for a variety of types.  */
 typedef char *char_addr;
+static char_addr a_char_addr;
 typedef unsigned short *ushort_addr;
+static ushort_addr a_ushort_addr;
 typedef signed long *slong_addr;
+static slong_addr a_slong_addr;
+#ifndef NO_LONG_LONG
+typedef signed long long *slong_long_addr;
+static slong_long_addr a_slong_long_addr;
+#endif
 
 char           *v_char_pointer;
 signed char    *v_signed_char_pointer;
@@ -82,6 +114,12 @@ long                *v_long_pointer;
 signed long    *v_signed_long_pointer;
 unsigned long  *v_unsigned_long_pointer;
 
+#ifndef NO_LONG_LONG
+long long              *v_long_long_pointer;
+signed long long       *v_signed_long_long_pointer;
+unsigned long long     *v_unsigned_long_long_pointer;
+#endif
+
 float          *v_float_pointer;
 double         *v_double_pointer;
 
@@ -92,6 +130,9 @@ struct t_struct {
     short      v_short_member;
     int                v_int_member;
     long       v_long_member;
+#ifndef NO_LONG_LONG
+    long long  v_long_long_member;
+#endif
     float      v_float_member;
     double     v_double_member;
 } v_struct1;
@@ -101,6 +142,9 @@ struct {
     short      v_short_member;
     int                v_int_member;
     long       v_long_member;
+#ifndef NO_LONG_LONG
+    long long  v_long_long_member;
+#endif
     float      v_float_member;
     double     v_double_member;
 } v_struct2;
@@ -112,6 +156,9 @@ union t_union {
     short      v_short_member;
     int                v_int_member;
     long       v_long_member;
+#ifndef NO_LONG_LONG
+    long long  v_long_long_member;
+#endif
     float      v_float_member;
     double     v_double_member;
 } v_union;
@@ -121,6 +168,9 @@ union {
     short      v_short_member;
     int                v_int_member;
     long       v_long_member;
+#ifndef NO_LONG_LONG
+    long long  v_long_long_member;
+#endif
     float      v_float_member;
     double     v_double_member;
 } v_union2;
@@ -143,6 +193,12 @@ long               v_long_func () { return (0); }
 signed long    v_signed_long_func () { return (0); }
 unsigned long  v_unsigned_long_func () { return (0); }
 
+#ifndef NO_LONG_LONG
+long long              v_long_long_func () { return (0); }
+signed long long       v_signed_long_long_func () { return (0); }
+unsigned long long     v_unsigned_long_long_func () { return (0); }
+#endif
+
 float          v_float_func () { return (0.0); }
 double         v_double_func () { return (0.0); }
 
@@ -188,12 +244,8 @@ enum cars {chevy, ford, porsche} clunker;
 
 /***********/
 
-main ()
+int main ()
 {
-#ifdef usestubs
-  set_debug_traps();
-  breakpoint();
-#endif
   /* Some linkers (e.g. on AIX) remove unreferenced variables,
      so make sure to reference them. */
   v_char = 0;
@@ -211,7 +263,13 @@ main ()
   v_long = 9;
   v_signed_long = 10;
   v_unsigned_long = 11;    
-  
+
+#ifndef NO_LONG_LONG
+  v_long_long = 12;
+  v_signed_long_long = 13;
+  v_unsigned_long_long = 14;
+#endif
+
   v_float = 100.0;
   v_double = 200.0;
 
@@ -232,6 +290,12 @@ main ()
   v_signed_long_array[0] = v_signed_long;
   v_unsigned_long_array[0] = v_unsigned_long;
 
+#ifndef NO_LONG_LONG
+  v_long_long_array[0] = v_long_long;
+  v_signed_long_long_array[0] = v_signed_long_long;
+  v_unsigned_long_long_array[0] = v_unsigned_long_long;
+#endif
+
   v_float_array[0] = v_float;
   v_double_array[0] = v_double;
 
@@ -251,6 +315,12 @@ main ()
   v_signed_long_pointer = &v_signed_long;
   v_unsigned_long_pointer = &v_unsigned_long;
 
+#ifndef NO_LONG_LONG
+  v_long_long_pointer = &v_long_long;
+  v_signed_long_long_pointer = &v_signed_long_long;
+  v_unsigned_long_long_pointer = &v_unsigned_long_long;
+#endif
+
   v_float_pointer = &v_float;
   v_double_pointer = &v_double;