aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/scope0.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2009-12-28 21:45:24 +0000
committerDaniel Jacobowitz <drow@false.org>2009-12-28 21:45:24 +0000
commit0219b378ea49d403ec68b0a1e36ad356930ab38d (patch)
tree66b7480b56ab5e8e6e8bd8ca112ba46b38a653d6 /gdb/testsuite/gdb.base/scope0.c
parent0fe7935b333f7332ffd501dc45ff73ceec09b45f (diff)
downloadgdb-0219b378ea49d403ec68b0a1e36ad356930ab38d.zip
gdb-0219b378ea49d403ec68b0a1e36ad356930ab38d.tar.gz
gdb-0219b378ea49d403ec68b0a1e36ad356930ab38d.tar.bz2
* gdb.base/find.c (main): Reference search buffers.
* gdb.base/included.c (main): Reference integer. * gdb.base/ptype.c (charfoo): Declare. (intfoo): Call charfoo. * gdb.base/scope0.c (useitp): New function. (usestatics): Use useitp. (useit): Add a type for val. * gdb.base/scope1.c (useit1): Take a pointer argument. (usestatics1): Update calls to useit1. * gdb.cp/call-c.cc: Declare foo. (main): Call foo. * gdb.cp/m-static.cc (main): Reference test4.elsewhere. * gdb.cp/namespace.cc (ensureOtherRefs): Declare. (main): Call C::ensureRefs and ensureOtherRefs. * gdb.cp/namespace1.cc (C::ensureOtherRefs): Also reference int variables. (ensureOtherRefs): New function. * gdb.cp/overload.cc (main): Call all overloadNamespace variants. * gdb.cp/templates.cc (main): Call t5i.value.
Diffstat (limited to 'gdb/testsuite/gdb.base/scope0.c')
-rw-r--r--gdb/testsuite/gdb.base/scope0.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/gdb/testsuite/gdb.base/scope0.c b/gdb/testsuite/gdb.base/scope0.c
index ad994fc..180a431 100644
--- a/gdb/testsuite/gdb.base/scope0.c
+++ b/gdb/testsuite/gdb.base/scope0.c
@@ -11,6 +11,7 @@ extern void foo();
int autovars (int bcd, int abc);
int localscopes (int x);
int useit (int val);
+int useitp (const int *val);
void init0();
void marker1 ();
void marker2 ();
@@ -30,12 +31,13 @@ int main ()
}
/* On some systems, such as AIX, unreferenced variables are deleted
- from the executable. */
+ from the executable. On other compilers, such as ARM RealView,
+ const variables without their address taken are deleted. */
void usestatics ()
{
- useit (filelocal);
- useit (filelocal_bss);
- useit (filelocal_ro);
+ useitp (&filelocal);
+ useitp (&filelocal_bss);
+ useitp (&filelocal_ro);
}
void init0 ()
@@ -68,7 +70,7 @@ int
useit (int val)
#else
int
-useit (val)
+useit (val) int val;
#endif
{
static int usedval;
@@ -79,6 +81,20 @@ useit (val)
#ifdef PROTOTYPES
int
+useitp (const int *val)
+#else
+int
+useitp (val) const int *val;
+#endif
+{
+ static int usedval;
+
+ usedval = *val;
+ return *val + sum_upto (0);
+}
+
+#ifdef PROTOTYPES
+int
autovars (int bcd, int abc)
#else
int