mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-03 07:14:18 +08:00
0219b378ea
* 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.
56 lines
1.1 KiB
C
56 lines
1.1 KiB
C
static int filelocal = 2; /* In Data section */
|
|
static int filelocal_bss; /* In BSS section */
|
|
#ifndef __STDC__
|
|
#define const /**/
|
|
#endif
|
|
static const int filelocal_ro = 202; /* In Read-Only Data section */
|
|
|
|
void foo ()
|
|
{
|
|
|
|
void bar ();
|
|
|
|
static int funclocal = 3; /* In Data section */
|
|
static int funclocal_bss; /* In BSS section */
|
|
static const int funclocal_ro = 203; /* RO Data */
|
|
static const int funclocal_ro_bss; /* RO Data */
|
|
|
|
funclocal_bss = 103;
|
|
bar ();
|
|
}
|
|
|
|
void bar ()
|
|
{
|
|
static int funclocal = 4; /* In data section */
|
|
static int funclocal_bss; /* In BSS section */
|
|
funclocal_bss = 104;
|
|
}
|
|
|
|
void init1 ()
|
|
{
|
|
filelocal_bss = 102;
|
|
}
|
|
|
|
/* On some systems, such as AIX, unreferenced variables are deleted
|
|
from the executable. On other compilers, such as ARM RealView,
|
|
const variables without their address taken are deleted. */
|
|
void usestatics1 ()
|
|
{
|
|
void useit1 (const int *val);
|
|
|
|
useit1 (&filelocal);
|
|
useit1 (&filelocal_bss);
|
|
useit1 (&filelocal_ro);
|
|
}
|
|
|
|
#ifdef PROTOTYPES
|
|
void useit1 (const int *val)
|
|
#else
|
|
void useit1 (val) const int *val;
|
|
#endif
|
|
{
|
|
static int usedval;
|
|
|
|
usedval = *val;
|
|
}
|