* gdb.cp/m-static.cc (keepalive): New function.
authorTom Tromey <tromey@redhat.com>
Tue, 19 Jun 2012 15:47:02 +0000 (15:47 +0000)
committerTom Tromey <tromey@redhat.com>
Tue, 19 Jun 2012 15:47:02 +0000 (15:47 +0000)
(gnu_obj_1::method): Use it.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/m-static.cc

index 595ff66..26e4ce0 100644 (file)
@@ -1,3 +1,8 @@
+2012-06-19  Tom Tromey  <tromey@redhat.com>
+
+       * gdb.cp/m-static.cc (keepalive): New function.
+       (gnu_obj_1::method): Use it.
+
 2012-06-18  Doug Evans  <dje@google.com>
 
        * gdb.base/info-fun.exp: New file.
index 7f997ef..e9dce18 100644 (file)
@@ -2,6 +2,8 @@
 
 enum region { oriental, egyptian, greek, etruscan, roman };
 
+void keepalive(bool *var) { }
+
 // Test one.
 class gnu_obj_1
 {
@@ -19,6 +21,7 @@ public:
   long method ()
   {
     static bool svar = true;
+    keepalive (&svar);
     return key2;
   }
 };