Update copyright year in most headers.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / whatis.c
index 6d8d1e64bb5421796d2a0bb8589be4fc6dc49a36..1f7cd8c5c820d319256d9649edd41fb4121a79be 100644 (file)
@@ -1,3 +1,22 @@
+/* This test program is part of GDB, the GNU debugger.
+
+   Copyright 1992, 1993, 1994, 1997, 1999, 2004, 2007, 2008, 2009, 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/>.
+   */
+
 /*
  *     Test file with lots of different types, for testing the
  *     "whatis" command.
@@ -7,10 +26,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 +42,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 +74,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 +90,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 +116,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 +132,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 +144,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 +158,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 +170,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 +195,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,7 +246,7 @@ enum cars {chevy, ford, porsche} clunker;
 
 /***********/
 
-main ()
+int main ()
 {
 #ifdef usestubs
   set_debug_traps();
@@ -211,7 +269,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 +296,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 +321,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;
 
This page took 0.026793 seconds and 4 git commands to generate.