From c60eb31fb11129ee91b9f778b852f886db545381 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Mon, 28 Sep 2015 13:27:28 -0700 Subject: [PATCH] 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. --- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.base/gcore.c | 2 ++ 2 files changed, 6 insertions(+) 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 (); } -- 2.30.2