]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.stabs/gdb11479.c
* gdb.stabs/gdb11479.c (hack): New function.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.stabs / gdb11479.c
index 257be5e360a6c2e825739f5f2ba89f5389a4b6bc..70ab5d901a3b503c0c457a4e7a3b54ad5cda6927 100644 (file)
@@ -23,13 +23,17 @@ struct dummy;
 
 enum dummy_enum;
 
+/* This function prevents the compiler from dropping local variables
+   we need for the test.  */
+void *hack (const struct dummy *t, const enum dummy_enum *e);
+
 const void *
 test (const struct dummy *t)
 {
   const struct dummy *tt;
   enum dummy_enum *e;
   tt = t;
-  return t;
+  return hack (t, e);
 }
 
 void *
@@ -38,7 +42,7 @@ test2 (struct dummy *t)
   struct dummy *tt;
   const enum dummy_enum *e;
   tt = t;
-  return t;
+  return hack (t, e);
 }
 
 
@@ -53,6 +57,12 @@ enum dummy_enum {
   enum2
 };
 
+void *
+hack (const struct dummy *t, const enum dummy_enum *e)
+{
+  return (void *) t;
+}
+
 int
 main ()
 {