diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 9c0d68b529..f6e221dbcb 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-05-03 Keith Seitz + + * gdb.cp/oranking.cc (dummy): New function to grab malloc. + (main): Call it. + 2017-05-01 Tim Wiederhake * gdb.python/py-record-btrace.exp: Rename prev_sibling and next_sibling diff --git a/gdb/testsuite/gdb.cp/oranking.cc b/gdb/testsuite/gdb.cp/oranking.cc index bd2f51bb05..135761016c 100644 --- a/gdb/testsuite/gdb.cp/oranking.cc +++ b/gdb/testsuite/gdb.cp/oranking.cc @@ -1,3 +1,18 @@ +#include + +/* Make sure `malloc' is linked into the program. If we don't, tests + in the accompanying expect file may fail: + + evaluation of this expression requires the program to have a function + "malloc". */ + +void +dummy () +{ + void *p = malloc (16); + + free (p); +} /* 1. A standard covnersion sequence is better than a user-defined sequence which is better than an elipses conversion sequence. */ @@ -165,6 +180,8 @@ test15 () } int main() { + dummy (); + B b; foo0(b); foo1(b);