From d31acd2c72687282be21ba9d6931e121681b83b4 Mon Sep 17 00:00:00 2001 From: kevinb Date: Thu, 18 Apr 2002 13:21:01 +0000 Subject: [PATCH] * gdb.base/cvexpr.c (use): New function. (main): Invoke use() on all global variables to prevent some linkers from deleting these otherwise unused symbols. --- gdb/testsuite/ChangeLog | 6 ++ gdb/testsuite/gdb.base/cvexpr.c | 156 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 161 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 722ce17fd9..9b9d1365a3 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2002-04-18 Kevin Buettner + + * 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 From David S. Miller diff --git a/gdb/testsuite/gdb.base/cvexpr.c b/gdb/testsuite/gdb.base/cvexpr.c index 176bbe9c51..587120928e 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); } -- 2.11.0