binutils-gdb/gdb/testsuite/gdb.base/overlays.c
Pedro Alves 2eb8215700 Remove stale -DNO_PROTOTYPES bits from gdb testsuite
The gdb.base/call-sc.exp, gdb.base/structs.exp and
gdb.base/structs2.exp testcases still try compiling the sources with
-DNO_PROTOTYPES, but the corresponding sources don't have any #ifdef
NO_PROTOTYPES any longer.  Those were removed throughout years ago.

OTOH, gdb.base/ovlymgr.h does check for NO_PROTOTYPES, but no .exp
file compiles it with -DNO_PROTOTYPES.

gdb.base/reread.exp and gdb.base/varargs.exp set a 'prototypes'
global, which is a stale bit left behind when the "try-compiling
without and then with -DNO_PROTOTYPES" logic was around.

gdb/testsuite/ChangeLog:

	* gdb.base/call-sc.exp (start_scalars_test): Use
	prepare_for_testing and don't try compiling with -DNO_PROTOTYPES.
	* gdb.base/overlays.c: Remove references to PARAMS.
	* gdb.base/ovlymgr.h (PARAMS): Delete, and remove all references.
	* gdb.base/reread.exp: Don't set 'prototypes' global.
	* gdb.base/structs.exp (start_structs_test): Use
	prepare_for_testing and don't try compiling with -DNO_PROTOTYPES.
	* gdb.base/structs2.exp: Don't set 'prototypes' global.  Use
	prepare_for_testing and don't try compiling with -DNO_PROTOTYPES.
	Don't issue "set width 0".  Remove gdb_stop_suppressing_tests
	call.
	* gdb.base/varargs.exp: Don't set 'prototypes' global.
2020-07-03 14:58:20 +01:00

35 lines
574 B
C

/* Support program for testing gdb's ability to debug overlays
in the inferior. */
#include "ovlymgr.h"
extern int foo (int);
extern int bar (int);
extern int baz (int);
extern int grbx (int);
int main ()
{
int a, b, c, d, e;
OverlayLoad (0);
OverlayLoad (4);
a = foo (1);
OverlayLoad (1);
OverlayLoad (5);
b = bar (1);
OverlayLoad (2);
OverlayLoad (6);
c = baz (1);
OverlayLoad (3);
OverlayLoad (7);
d = grbx (1);
e = a + b + c + d;
return (e != ('f' + 'o' +'o'
+ 'b' + 'a' + 'r'
+ 'b' + 'a' + 'z'
+ 'g' + 'r' + 'b' + 'x'));
}