aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-04-10 23:45:28 -0700
committerDavid Blaikie <dblaikie@gmail.com>2014-04-24 22:33:46 -0700
commit2abc3f8d59e0130e5340a5489b53556f12c9d0ce (patch)
treeebf0a63d7b75cc28f95730b831108de8f63e28ff
parentbfd39632142cba581a430e41ed38c5153d1fc07a (diff)
downloadgdb-2abc3f8d59e0130e5340a5489b53556f12c9d0ce.zip
gdb-2abc3f8d59e0130e5340a5489b53556f12c9d0ce.tar.gz
gdb-2abc3f8d59e0130e5340a5489b53556f12c9d0ce.tar.bz2
Ensure unreferenced static symbols aren't omitted by clang (either marking them __attribute__((used)) or making them non-static)
gdb/testsuite/ * gdb.base/catch-syscall.c: Make unreferenced statics non-static to ensure clang would not discard them. * gdb.base/gdbvars.c: Ditto. * gdb.base/memattr.c: Ditto. * gdb.base/whatis.c: Ditto. * gdb.python/py-prettyprint.c: Ditto. * gdb.trace/actions.c: Ditto. * gdb.cp/ptype-cv-cp.cc: Mark unused global const int as used to ensure clang would not discard it.
-rw-r--r--gdb/testsuite/ChangeLog12
-rw-r--r--gdb/testsuite/gdb.base/catch-syscall.c12
-rw-r--r--gdb/testsuite/gdb.base/gdbvars.c4
-rw-r--r--gdb/testsuite/gdb.base/memattr.c10
-rw-r--r--gdb/testsuite/gdb.base/whatis.c8
-rw-r--r--gdb/testsuite/gdb.cp/ptype-cv-cp.cc2
-rw-r--r--gdb/testsuite/gdb.python/py-prettyprint.c2
-rw-r--r--gdb/testsuite/gdb.trace/actions.c2
8 files changed, 32 insertions, 20 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index c028cd5..ecea520 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,17 @@
2014-04-24 David Blaikie <dblaikie@gmail.com>
+ * gdb.base/catch-syscall.c: Make unreferenced statics non-static to
+ ensure clang would not discard them.
+ * gdb.base/gdbvars.c: Ditto.
+ * gdb.base/memattr.c: Ditto.
+ * gdb.base/whatis.c: Ditto.
+ * gdb.python/py-prettyprint.c: Ditto.
+ * gdb.trace/actions.c: Ditto.
+ * gdb.cp/ptype-cv-cp.cc: Mark unused global const int as used to
+ ensure clang would not discard it.
+
+2014-04-24 David Blaikie <dblaikie@gmail.com>
+
* gdb.stabs/gdb11479.c (tag_dummy_enum): introduce a variable to cause
clang to emit the full definition of type required by the test
* gdb.stabs/gdb11479.exp (do_test): correct a typo in a test message
diff --git a/gdb/testsuite/gdb.base/catch-syscall.c b/gdb/testsuite/gdb.base/catch-syscall.c
index aa5727a..ea33b93 100644
--- a/gdb/testsuite/gdb.base/catch-syscall.c
+++ b/gdb/testsuite/gdb.base/catch-syscall.c
@@ -14,16 +14,16 @@
/* These are the syscalls numbers used by the test. */
-static int close_syscall = SYS_close;
-static int chroot_syscall = SYS_chroot;
+int close_syscall = SYS_close;
+int chroot_syscall = SYS_chroot;
/* GDB had a bug where it couldn't catch syscall number 0 (PR 16297).
In most GNU/Linux architectures, syscall number 0 is
restart_syscall, which can't be called from userspace. However,
the "read" syscall is zero on x86_64. */
-static int read_syscall = SYS_read;
-static int pipe_syscall = SYS_pipe;
-static int write_syscall = SYS_write;
-static int exit_group_syscall = SYS_exit_group;
+int read_syscall = SYS_read;
+int pipe_syscall = SYS_pipe;
+int write_syscall = SYS_write;
+int exit_group_syscall = SYS_exit_group;
int
main (void)
diff --git a/gdb/testsuite/gdb.base/gdbvars.c b/gdb/testsuite/gdb.base/gdbvars.c
index 352a76b..46fa84b 100644
--- a/gdb/testsuite/gdb.base/gdbvars.c
+++ b/gdb/testsuite/gdb.base/gdbvars.c
@@ -4,12 +4,12 @@ typedef void *ptr;
ptr p = &p;
-static void
+void
foo_void (void)
{
}
-static int
+int
foo_int (void)
{
return 0;
diff --git a/gdb/testsuite/gdb.base/memattr.c b/gdb/testsuite/gdb.base/memattr.c
index 74b2d61..62868b6 100644
--- a/gdb/testsuite/gdb.base/memattr.c
+++ b/gdb/testsuite/gdb.base/memattr.c
@@ -16,11 +16,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#define MEMSIZE 64
-static int mem1[MEMSIZE] = {111, 222, 333, 444, 555};
-static int mem2[MEMSIZE];
-static int mem3[MEMSIZE];
-static int mem4[MEMSIZE];
-static int mem5[MEMSIZE];
+int mem1[MEMSIZE] = {111, 222, 333, 444, 555};
+int mem2[MEMSIZE];
+int mem3[MEMSIZE];
+int mem4[MEMSIZE];
+int mem5[MEMSIZE];
int main()
{
diff --git a/gdb/testsuite/gdb.base/whatis.c b/gdb/testsuite/gdb.base/whatis.c
index a1a3188..bcda5fd 100644
--- a/gdb/testsuite/gdb.base/whatis.c
+++ b/gdb/testsuite/gdb.base/whatis.c
@@ -88,14 +88,14 @@ double v_double_array[2];
a special case kludge in GDB (Unix system include files like to define
caddr_t), but for a variety of types. */
typedef char *char_addr;
-static char_addr a_char_addr;
+char_addr a_char_addr;
typedef unsigned short *ushort_addr;
-static ushort_addr a_ushort_addr;
+ushort_addr a_ushort_addr;
typedef signed long *slong_addr;
-static slong_addr a_slong_addr;
+slong_addr a_slong_addr;
#ifndef NO_LONG_LONG
typedef signed long long *slong_long_addr;
-static slong_long_addr a_slong_long_addr;
+slong_long_addr a_slong_long_addr;
#endif
char *v_char_pointer;
diff --git a/gdb/testsuite/gdb.cp/ptype-cv-cp.cc b/gdb/testsuite/gdb.cp/ptype-cv-cp.cc
index 6546f68..add4021 100644
--- a/gdb/testsuite/gdb.cp/ptype-cv-cp.cc
+++ b/gdb/testsuite/gdb.cp/ptype-cv-cp.cc
@@ -22,7 +22,7 @@ typedef volatile const_my_int volatile_const_my_int;
typedef const volatile_my_int const_volatile_my_int;
my_int v_my_int (0);
-const_my_int v_const_my_int (1);
+__attribute__((used)) const_my_int v_const_my_int (1);
volatile_my_int v_volatile_my_int (2);
const_volatile_my_int v_const_volatile_my_int (3);
volatile_const_my_int v_volatile_const_my_int (4);
diff --git a/gdb/testsuite/gdb.python/py-prettyprint.c b/gdb/testsuite/gdb.python/py-prettyprint.c
index 0fd05f5..817bf33 100644
--- a/gdb/testsuite/gdb.python/py-prettyprint.c
+++ b/gdb/testsuite/gdb.python/py-prettyprint.c
@@ -230,7 +230,7 @@ struct nullstr
struct string_repr string_1 = { { "one" } };
struct string_repr string_2 = { { "two" } };
-static int
+int
eval_func (int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8)
{
return p1;
diff --git a/gdb/testsuite/gdb.trace/actions.c b/gdb/testsuite/gdb.trace/actions.c
index 04c69f2..497d04d 100644
--- a/gdb/testsuite/gdb.trace/actions.c
+++ b/gdb/testsuite/gdb.trace/actions.c
@@ -116,7 +116,7 @@ unsigned long gdb_c_test( unsigned long *parm )
return ( (unsigned long) 0 );
}
-static void gdb_asm_test (void)
+void gdb_asm_test (void)
{
}