From: Doug Evans Date: Mon, 28 Sep 2015 20:27:28 +0000 (-0700) Subject: gdb.base/gcore.c (array_func): Add reference to static_array. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c60eb31fb11129ee91b9f778b852f886db545381;p=binutils-gdb.git gdb.base/gcore.c (array_func): Add reference to static_array. Otherwise clang will delete it: it's otherwise unused. gdb/testsuite/ChangeLog: * gdb.base/gcore.c (array_func): Add reference to static_array. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 7d52ba0252b..344e633d842 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-09-28 Doug Evans + + * gdb.base/gcore.c (array_func): Add reference to static_array. + 2015-09-25 Simon Marchi * gdb.gdb/selftest.exp (do_steps_and_nexts): Adjust expected diff --git a/gdb/testsuite/gdb.base/gcore.c b/gdb/testsuite/gdb.base/gcore.c index d6acc1f9b9c..b6d8d54e5df 100644 --- a/gdb/testsuite/gdb.base/gcore.c +++ b/gdb/testsuite/gdb.base/gcore.c @@ -46,6 +46,8 @@ array_func () un_initialized_array[i] = extern_array[i] + 8; local_array[i] = extern_array[i] + 12; } + /* Reference static_array so that clang doesn't discard it. */ + (void) static_array[0]; terminal_func (); }