diff options
author | Daniel Jacobowitz <drow@false.org> | 2009-11-12 19:35:26 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2009-11-12 19:35:26 +0000 |
commit | f0df251a26c53481e32d390da65acbdea79f3a82 (patch) | |
tree | 3fea99fc5ef5e86b140c3f6e20c546b9ee268686 /gdb | |
parent | ba950e4de515992b73b879bf39732daa8351eb45 (diff) | |
download | gdb-f0df251a26c53481e32d390da65acbdea79f3a82.zip gdb-f0df251a26c53481e32d390da65acbdea79f3a82.tar.gz gdb-f0df251a26c53481e32d390da65acbdea79f3a82.tar.bz2 |
* gdb.base/break.c (need_malloc): New.
* gdb.base/constvars.c (main): Reference crass and crisp.
* gdb.base/gdb1821.c (main): Reference bar.
* gdb.cp/gdb1355.cc (main): Reference s1.
* gdb.cp/hang1.cc (dummy2, dummy3): Declare.
(main): Call them.
* gdb.cp/hang2.cc (dummy2): Define.
* gdb.cp/hang3.cc (dummy3): Define.
* gdb.cp/m-data.cc (main): Reference shadow.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/ChangeLog | 12 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/break.c | 7 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/constvars.c | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/gdb1821.c | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/gdb1355.cc | 3 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/hang1.cc | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/hang2.cc | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/hang3.cc | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.cp/m-data.cc | 2 |
9 files changed, 41 insertions, 4 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 059deaa..fad62b5 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,4 +1,16 @@ 2009-11-12 Daniel Jacobowitz <dan@codesourcery.com> + + * gdb.base/break.c (need_malloc): New. + * gdb.base/constvars.c (main): Reference crass and crisp. + * gdb.base/gdb1821.c (main): Reference bar. + * gdb.cp/gdb1355.cc (main): Reference s1. + * gdb.cp/hang1.cc (dummy2, dummy3): Declare. + (main): Call them. + * gdb.cp/hang2.cc (dummy2): Define. + * gdb.cp/hang3.cc (dummy3): Define. + * gdb.cp/m-data.cc (main): Reference shadow. + +2009-11-12 Daniel Jacobowitz <dan@codesourcery.com> Nathan Froyd <froydnj@codesourcery.com> * lib/gdb.exp (gdb_compile): Also set rpath for shlib=, on a diff --git a/gdb/testsuite/gdb.base/break.c b/gdb/testsuite/gdb.base/break.c index 69082bb..8678236 100644 --- a/gdb/testsuite/gdb.base/break.c +++ b/gdb/testsuite/gdb.base/break.c @@ -62,6 +62,13 @@ extern void marker3 (); extern void marker4 (); #endif +/* We're used by a test that requires malloc, so make sure it is in + the executable. */ +void *need_malloc () +{ + return malloc (1); +} + /* * This simple classical example of recursion is useful for * testing stack backtraces and such. diff --git a/gdb/testsuite/gdb.base/constvars.c b/gdb/testsuite/gdb.base/constvars.c index 188edb8..9c11c38 100644 --- a/gdb/testsuite/gdb.base/constvars.c +++ b/gdb/testsuite/gdb.base/constvars.c @@ -172,6 +172,10 @@ main (void) struct crass { char * const ptr; } crass = { lamprey }; struct crisp { char * const *ptr; } crisp = { &lamprey }; + /* Reference the structs so that they are not discarded. */ + struct crass *creed = &crass; + struct crisp *crow = &crisp; + /* misc. references */ /* const char & radiation = laconic; diff --git a/gdb/testsuite/gdb.base/gdb1821.c b/gdb/testsuite/gdb.base/gdb1821.c index 5638973..8dfdb08 100644 --- a/gdb/testsuite/gdb.base/gdb1821.c +++ b/gdb/testsuite/gdb.base/gdb1821.c @@ -20,4 +20,4 @@ struct foo { double x__0, y__0, z__1; } bar; -int main(void) { return 0; } +int main(void) { return (int) bar.x__0; } diff --git a/gdb/testsuite/gdb.cp/gdb1355.cc b/gdb/testsuite/gdb.cp/gdb1355.cc index a53ca20..51e625f 100644 --- a/gdb/testsuite/gdb.cp/gdb1355.cc +++ b/gdb/testsuite/gdb.cp/gdb1355.cc @@ -31,5 +31,6 @@ struct mystruct s1 = int main () { - return 0; + /* Reference s1 so that it is included. */ + return s1.m_int - 117; } diff --git a/gdb/testsuite/gdb.cp/hang1.cc b/gdb/testsuite/gdb.cp/hang1.cc index 4b04d77..d9b0672 100644 --- a/gdb/testsuite/gdb.cp/hang1.cc +++ b/gdb/testsuite/gdb.cp/hang1.cc @@ -1,3 +1,6 @@ #include "hang.H" -int main (int argc, char **argv) { return 0; } +extern int dummy2 (void); +extern int dummy3 (void); + +int main (int argc, char **argv) { return dummy2() + dummy3(); } diff --git a/gdb/testsuite/gdb.cp/hang2.cc b/gdb/testsuite/gdb.cp/hang2.cc index 59732f8..15dcb14 100644 --- a/gdb/testsuite/gdb.cp/hang2.cc +++ b/gdb/testsuite/gdb.cp/hang2.cc @@ -6,3 +6,8 @@ struct B }; int var_in_b = 1729; + +int dummy2 (void) +{ + return var_in_b; +} diff --git a/gdb/testsuite/gdb.cp/hang3.cc b/gdb/testsuite/gdb.cp/hang3.cc index 92c82fa..b08decc 100644 --- a/gdb/testsuite/gdb.cp/hang3.cc +++ b/gdb/testsuite/gdb.cp/hang3.cc @@ -2,3 +2,8 @@ const struct B *const_B_ptr; int var_in_hang3 = 42; + +int dummy3 (void) +{ + return var_in_hang3; +} diff --git a/gdb/testsuite/gdb.cp/m-data.cc b/gdb/testsuite/gdb.cp/m-data.cc index c97e719..65e70fa 100644 --- a/gdb/testsuite/gdb.cp/m-data.cc +++ b/gdb/testsuite/gdb.cp/m-data.cc @@ -60,5 +60,5 @@ int main() C theC (1); // breakpoint: first-constructs-done theC.marker (); - return 0; + return shadow; } |