OSDN Git Service

* gdb.base/find.c (main): Reference search buffers.
authordrow <drow>
Tue, 29 Dec 2009 06:45:24 +0000 (06:45 +0000)
committerdrow <drow>
Tue, 29 Dec 2009 06:45:24 +0000 (06:45 +0000)
* gdb.base/included.c (main): Reference integer.
* gdb.base/ptype.c (charfoo): Declare.
(intfoo): Call charfoo.
* gdb.base/scope0.c (useitp): New function.
(usestatics): Use useitp.
(useit): Add a type for val.
* gdb.base/scope1.c (useit1): Take a pointer argument.
(usestatics1): Update calls to useit1.
* gdb.cp/call-c.cc: Declare foo.
(main): Call foo.
* gdb.cp/m-static.cc (main): Reference test4.elsewhere.
* gdb.cp/namespace.cc (ensureOtherRefs): Declare.
(main): Call C::ensureRefs and ensureOtherRefs.
* gdb.cp/namespace1.cc (C::ensureOtherRefs): Also reference int
variables.
(ensureOtherRefs): New function.
* gdb.cp/overload.cc (main): Call all overloadNamespace variants.
* gdb.cp/templates.cc (main): Call t5i.value.

12 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/find.c
gdb/testsuite/gdb.base/included.c
gdb/testsuite/gdb.base/ptype.c
gdb/testsuite/gdb.base/scope0.c
gdb/testsuite/gdb.base/scope1.c
gdb/testsuite/gdb.cp/call-c.cc
gdb/testsuite/gdb.cp/m-static.cc
gdb/testsuite/gdb.cp/namespace.cc
gdb/testsuite/gdb.cp/namespace1.cc
gdb/testsuite/gdb.cp/overload.cc
gdb/testsuite/gdb.cp/templates.cc

index 8aef477..efebac1 100644 (file)
@@ -1,3 +1,25 @@
+2009-12-28  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * gdb.base/find.c (main): Reference search buffers.
+       * gdb.base/included.c (main): Reference integer.
+       * gdb.base/ptype.c (charfoo): Declare.
+       (intfoo): Call charfoo.
+       * gdb.base/scope0.c (useitp): New function.
+       (usestatics): Use useitp.
+       (useit): Add a type for val.
+       * gdb.base/scope1.c (useit1): Take a pointer argument.
+       (usestatics1): Update calls to useit1.
+       * gdb.cp/call-c.cc: Declare foo.
+       (main): Call foo.
+       * gdb.cp/m-static.cc (main): Reference test4.elsewhere.
+       * gdb.cp/namespace.cc (ensureOtherRefs): Declare.
+       (main): Call C::ensureRefs and ensureOtherRefs.
+       * gdb.cp/namespace1.cc (C::ensureOtherRefs): Also reference int
+       variables.
+       (ensureOtherRefs): New function.
+       * gdb.cp/overload.cc (main): Call all overloadNamespace variants.
+       * gdb.cp/templates.cc (main): Call t5i.value.
+
 2009-12-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        Fix compatibility with G++-4.5.
index 77acec9..4a4bb79 100644 (file)
@@ -67,5 +67,11 @@ main ()
 
   stop_here ();
 
+  /* Reference variables.  */
+  x = int8_search_buf[0];
+  x = int16_search_buf[0];
+  x = int32_search_buf[0];
+  x = int64_search_buf[0];
+
   return 0;
 }
index 4bf004f..b58959d 100644 (file)
@@ -20,5 +20,5 @@
 int
 main()
 {
-  return 0;
+  return integer;
 }
index 46769ad..b154ab4 100644 (file)
@@ -269,10 +269,13 @@ func_type v_func_type;
 
 /***********/
 
+extern char charfoo ();
+
 typedef int foo;
 
 foo intfoo (afoo)
 {
+  charfoo (afoo);
   return (afoo * 2);
 }
 
index 3a1b89e..180a431 100644 (file)
@@ -5,7 +5,20 @@ static int filelocal_bss;      /* In BSS section */
 #endif
 static const int filelocal_ro = 201;   /* In Read-Only Data section */
 
-main ()
+extern void init1();
+extern void foo();
+
+int autovars (int bcd, int abc);
+int localscopes (int x);
+int useit (int val);
+int useitp (const int *val);
+void init0();
+void marker1 ();
+void marker2 ();
+void marker3 ();
+void marker4 ();
+
+int main ()
 {
 #ifdef usestubs
   set_debug_traps();
@@ -18,15 +31,16 @@ main ()
 }
 
 /* On some systems, such as AIX, unreferenced variables are deleted
-   from the executable.  */
-usestatics ()
+   from the executable.  On other compilers, such as ARM RealView,
+   const variables without their address taken are deleted.  */
+void usestatics ()
 {
-  useit (filelocal);
-  useit (filelocal_bss);
-  useit (filelocal_ro);
+  useitp (&filelocal);
+  useitp (&filelocal_bss);
+  useitp (&filelocal_ro);
 }
 
-init0 ()
+void init0 ()
 {
   filelocal_bss = 101;
   init1 ();
@@ -34,9 +48,14 @@ init0 ()
 
 /* This is to derail optimizer in localscopes.
    Return 1 + 2 + . . . + N.  */
+#ifdef PROTOTYPES
+int
+sum_upto (int n)
+#else
 int
 sum_upto (n)
      int n;
+#endif
 {
   int i;
   int retval = 0;
@@ -46,8 +65,13 @@ sum_upto (n)
   return retval;
 }
 
+#ifdef PROTOTYPES
 int
-useit (val)
+useit (int val)
+#else
+int
+useit (val) int val;
+#endif
 {
     static int usedval;
 
@@ -55,10 +79,29 @@ useit (val)
     return val + sum_upto (0);
 }
 
+#ifdef PROTOTYPES
+int
+useitp (const int *val)
+#else
+int
+useitp (val) const int *val;
+#endif
+{
+    static int usedval;
+
+    usedval = *val;
+    return *val + sum_upto (0);
+}
+
+#ifdef PROTOTYPES
+int
+autovars (int bcd, int abc)
+#else
 int
 autovars (bcd, abc)
      int bcd;
      int abc;
+#endif
 {
     int  i0 =  useit (0),  i1 =  useit (1),  i2 =  useit (2);
     int  i3 =  useit (3),  i4 =  useit (4),  i5 =  useit (5);
@@ -133,9 +176,14 @@ autovars (bcd, abc)
       + i91 + i92 + i93 + i94 + i95 + i96 + i97 + i98 + i99 + abc + bcd;
 }
 
+#ifdef PROTOTYPES
+int
+localscopes (int x)
+#else
 int
 localscopes (x)
      int x;
+#endif
 {
     int localval;
     int retval;
@@ -170,7 +218,7 @@ localscopes (x)
     return retval;
 }
 
-marker1 () {}
-marker2 () {}
-marker3 () {}
-marker4 () {}
+void marker1 () {}
+void marker2 () {}
+void marker3 () {}
+void marker4 () {}
index cccad6f..2631ead 100644 (file)
@@ -5,8 +5,11 @@ static int filelocal_bss;      /* In BSS section */
 #endif
 static const int filelocal_ro = 202;   /* In Read-Only Data section */
 
-foo ()
+void foo ()
 {
+
+  void bar ();
+  
   static int funclocal = 3;    /* In Data section */
   static int funclocal_bss;    /* In BSS section */
   static const int funclocal_ro = 203; /* RO Data */
@@ -16,30 +19,37 @@ foo ()
   bar ();
 }
 
-bar ()
+void bar ()
 {
   static int funclocal = 4;    /* In data section */
   static int funclocal_bss;    /* In BSS section */
   funclocal_bss = 104;
 }
 
-init1 ()
+void init1 ()
 {
   filelocal_bss = 102;
 }
 
 /* On some systems, such as AIX, unreferenced variables are deleted
-   from the executable.  */
-usestatics1 ()
+   from the executable.  On other compilers, such as ARM RealView,
+   const variables without their address taken are deleted.  */
+void usestatics1 ()
 {
-  useit1 (filelocal);
-  useit1 (filelocal_bss);
-  useit1 (filelocal_ro);
+  void useit1 (const int *val);
+  
+  useit1 (&filelocal);
+  useit1 (&filelocal_bss);
+  useit1 (&filelocal_ro);
 }
 
-useit1 (val)
+#ifdef PROTOTYPES
+void useit1 (const int *val)
+#else
+void useit1 (val) const int *val;
+#endif
 {
     static int usedval;
 
-    usedval = val;
+    usedval = *val;
 }
index cc90993..c648010 100644 (file)
@@ -30,6 +30,10 @@ struct Foo {
 
 typedef Foo *FooHandle;
 
+extern "C" {
+  int foo(int);
+}
+
 int main()
 {
     Foo f;
@@ -37,5 +41,6 @@ int main()
     Foo* &rf = pf;
     FooHandle handle = pf;
     rf->func(); /* set breakpoint here */
+    foo(0);
     return func(0);
 }
index 9dae5ee..2a0b61c 100644 (file)
@@ -68,6 +68,7 @@ int main()
   gnu_obj_3<long>      test3(greek);
   gnu_obj_4            test4;
 
+  test4.dummy = test4.elsewhere;
   test4.dummy = 0;
   return test4.dummy;  // breakpoint: constructs-done
 }
index ee55168..4ac9187 100644 (file)
@@ -168,6 +168,8 @@ namespace C
   }
 }
 
+extern int ensureOtherRefs ();
+
 int main ()
 {
   using AAA::inA;
@@ -195,4 +197,7 @@ int main ()
   marker1();
   
   C::D::marker2 ();
+
+  C::ensureRefs ();
+  ensureOtherRefs ();
 }
index 6dff59e..2ce74a5 100644 (file)
@@ -23,19 +23,26 @@ namespace C
     int z;
   };
 
-  void ensureOtherRefs () {
-    // NOTE (2004-04-23, carlton): This function is here only to make
-    // sure that GCC 3.4 outputs debug info for this class.
-    static OtherFileClass *c = new OtherFileClass();
-  }
-
   namespace {
     int cXOtherFile = 29;
   };
 
   int cOtherFile = 316;
+
+  void ensureOtherRefs () {
+    // NOTE (2004-04-23, carlton): This function is here only to make
+    // sure that GCC 3.4 outputs debug info for this class.
+    static OtherFileClass *c = new OtherFileClass();
+    c->z = cOtherFile + cXOtherFile;
+  }
 }
 
 namespace {
   int XOtherFile = 317;
 }
+
+int ensureOtherRefs ()
+{
+  C::ensureOtherRefs ();
+  return XOtherFile;
+}
index a41e14d..64c2090 100644 (file)
@@ -102,6 +102,10 @@ int main ()
        breakpoint();
     #endif
 
+    overloadNamespace (1);
+    overloadNamespace (dummyInstance);
+    XXX::overloadNamespace ('a');
+
     // Verify that intToChar should work:
     intToChar(1);
 
index dfb6f8e..783bc2c 100644 (file)
@@ -782,8 +782,10 @@ int main()
 
   intBazOne ibo;
   z = ibo.baz (2, 21);
+
+  t5i.value();
+
   return 0;
-    
 }