2014-07-01 Luis Machado * gdb.base/code_elim2.c (my_global_array): New global variable. (my_global_func): Use global variable. diff --git a/gdb/testsuite/gdb.base/code_elim2.c b/gdb/testsuite/gdb.base/code_elim2.c index 64ecc04..3eb8d5c 100644 --- a/gdb/testsuite/gdb.base/code_elim2.c +++ b/gdb/testsuite/gdb.base/code_elim2.c @@ -15,6 +15,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +/* Declare a global variable of reasonable size to make sure the .data section + is created, preventing a warning from GDB when manually loading symbols. */ +int my_global_array[6] = {4, 8, 15, 16, 23, 42}; int my_global_symbol = 42; static int my_static_symbol; @@ -28,7 +31,7 @@ main () int my_global_func () { - my_static_symbol = my_global_symbol; - my_global_symbol = my_static_symbol + my_global_symbol; + my_static_symbol = my_global_symbol + my_global_array[6]; + my_global_symbol = my_static_symbol + my_global_symbol + my_global_array[3]; return my_global_symbol; }