summaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2002-04-18 13:21:03 +0000
committerKevin Buettner <kevinb@redhat.com>2002-04-18 13:21:03 +0000
commitd76001ef7ad52e464483e88ca074486597ad24bb (patch)
tree134789ddb578250c6f6e9f07e0a783086b2a9aa7 /gdb/testsuite
parent2c074e4ff4dade7e433ac0a00d746a342307c9c3 (diff)
downloadgdb-d76001ef7ad52e464483e88ca074486597ad24bb.tar.gz
* gdb.base/cvexpr.c (use): New function.
(main): Invoke use() on all global variables to prevent some linkers from deleting these otherwise unused symbols.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.base/cvexpr.c156
2 files changed, 161 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 722ce17fd97..9b9d1365a3f 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2002-04-18 Kevin Buettner <kevinb@redhat.com>
+
+ * gdb.base/cvexpr.c (use): New function.
+ (main): Invoke use() on all global variables to prevent
+ some linkers from deleting these otherwise unused symbols.
+
2002-04-17 Michael Chastain <mec@shout.net>
From David S. Miller <davem@redhat.com>
diff --git a/gdb/testsuite/gdb.base/cvexpr.c b/gdb/testsuite/gdb.base/cvexpr.c
index 176bbe9c51a..587120928e4 100644
--- a/gdb/testsuite/gdb.base/cvexpr.c
+++ b/gdb/testsuite/gdb.base/cvexpr.c
@@ -273,8 +273,162 @@ unsigned long long (*v_unsigned_long_long_func) (int, int*);
float (*v_float_func) (int, int*);
double (*v_double_func) (int, int*);
-
+void use (void *p)
+{
+}
int main ()
{
+ use (&v_char);
+ use (&v_signed_char);
+ use (&v_unsigned_char);
+
+ use (&v_short);
+ use (&v_signed_short);
+ use (&v_unsigned_short);
+
+ use (&v_int);
+ use (&v_signed_int);
+ use (&v_unsigned_int);
+
+ use (&v_long);
+ use (&v_signed_long);
+ use (&v_unsigned_long);
+
+ use (&v_long_long);
+ use (&v_signed_long_long);
+ use (&v_unsigned_long_long);
+
+ use (&v_float);
+ use (&v_double);
+
+ use (v_char_array);
+ use (v_signed_char_array);
+ use (v_unsigned_char_array);
+
+ use (v_short_array);
+ use (v_signed_short_array);
+ use (v_unsigned_short_array);
+
+ use (v_int_array);
+ use (v_signed_int_array);
+ use (v_unsigned_int_array);
+
+ use (v_long_array);
+ use (v_signed_long_array);
+ use (v_unsigned_long_array);
+
+ use (v_float_array);
+ use (v_double_array);
+
+ use (v_char_pointer);
+ use (v_signed_char_pointer);
+ use (v_unsigned_char_pointer);
+
+ use (v_short_pointer);
+ use (v_signed_short_pointer);
+ use (v_unsigned_short_pointer);
+
+ use (v_int_pointer);
+ use (v_signed_int_pointer);
+ use (v_unsigned_int_pointer);
+
+ use (v_long_pointer);
+ use (v_signed_long_pointer);
+ use (v_unsigned_long_pointer);
+
+ use (v_float_pointer);
+ use (v_double_pointer);
+
+ use (v_char_pointer_pointer);
+ use (v_signed_char_pointer_pointer);
+ use (v_unsigned_char_pointer_pointer);
+
+ use (v_short_pointer_pointer);
+ use (v_signed_short_pointer_pointer);
+ use (v_unsigned_short_pointer_pointer);
+
+ use (v_int_pointer_pointer);
+ use (v_signed_int_pointer_pointer);
+ use (v_unsigned_int_pointer_pointer);
+
+ use (v_long_pointer_pointer);
+ use (v_signed_long_pointer_pointer);
+ use (v_unsigned_long_pointer_pointer);
+
+ use (v_float_pointer_pointer);
+ use (v_double_pointer_pointer);
+
+ use (v_char_array_pointer);
+ use (v_signed_char_array_pointer);
+ use (v_unsigned_char_array_pointer);
+
+ use (v_short_array_pointer);
+ use (v_signed_short_array_pointer);
+ use (v_unsigned_short_array_pointer);
+
+ use (v_int_array_pointer);
+ use (v_signed_int_array_pointer);
+ use (v_unsigned_int_array_pointer);
+
+ use (v_long_array_pointer);
+ use (v_signed_long_array_pointer);
+ use (v_unsigned_long_array_pointer);
+
+ use (v_float_array_pointer);
+ use (v_double_array_pointer);
+
+ use (v_char_pointer_array);
+ use (v_signed_char_pointer_array);
+ use (v_unsigned_char_pointer_array);
+
+ use (v_short_pointer_array);
+ use (v_signed_short_pointer_array);
+ use (v_unsigned_short_pointer_array);
+
+ use (v_int_pointer_array);
+ use (v_signed_int_pointer_array);
+ use (v_unsigned_int_pointer_array);
+
+ use (v_long_pointer_array);
+ use (v_signed_long_pointer_array);
+ use (v_unsigned_long_pointer_array);
+
+ use (v_float_pointer_array);
+ use (v_double_pointer_array);
+
+ use (&v_struct1);
+ use (&v_struct2);
+ use (&v_struct3);
+
+ use (&v_union);
+ use (&v_union2);
+ use (&v_union3);
+
+ use (&v_boolean);
+ use (&v_boolean2);
+ use (&v_misordered);
+
+ use (v_char_func);
+ use (v_signed_char_func);
+ use (v_unsigned_char_func);
+
+ use (v_short_func);
+ use (v_signed_short_func);
+ use (v_unsigned_short_func);
+
+ use (v_int_func);
+ use (v_signed_int_func);
+ use (v_unsigned_int_func);
+
+ use (v_long_func);
+ use (v_signed_long_func);
+ use (v_unsigned_long_func);
+
+ use (v_long_long_func);
+ use (v_signed_long_long_func);
+ use (v_unsigned_long_long_func);
+
+ use (v_float_func);
+ use (v_double_func);
}