From 7474326cb9441644313cb749e491bec5e001d236 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 17 Sep 2020 23:33:43 +0100 Subject: [PATCH] gdb.cp/call-c.exp C++ify Make the testcase work when built with a C++ compiler. gdb/testsuite/ChangeLog: * gdb.cp/call-c-1.c (foo) [__cplusplus]: Add extern "C". --- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.cp/call-c-1.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index ded85f23d3b..4034c734c65 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2020-09-17 Pedro Alves + + * gdb.cp/call-c-1.c (foo) [__cplusplus]: Add extern "C". + 2020-09-17 Pedro Alves * gdb.python/py-frame-inline.exp: Adjust to optionally expect a diff --git a/gdb/testsuite/gdb.cp/call-c-1.c b/gdb/testsuite/gdb.cp/call-c-1.c index 5d3d019672d..fa79f0311bc 100644 --- a/gdb/testsuite/gdb.cp/call-c-1.c +++ b/gdb/testsuite/gdb.cp/call-c-1.c @@ -15,4 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#ifdef __cplusplus +extern "C" +#endif int foo(int x) { return x; } -- 2.39.2