From patchwork Sat Nov 9 20:59:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Simon Marchi (Code Review)" X-Patchwork-Id: 35769 Received: (qmail 119591 invoked by alias); 9 Nov 2019 20:59:13 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 119528 invoked by uid 89); 9 Nov 2019 20:59:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 09 Nov 2019 20:59:11 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id E58CF20399; Sat, 9 Nov 2019 15:59:09 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id 898FC20C05 for ; Sat, 9 Nov 2019 15:59:04 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 78BDE2816F for ; Sat, 9 Nov 2019 15:59:04 -0500 (EST) X-Gerrit-PatchSet: 1 Date: Sat, 9 Nov 2019 15:59:04 -0500 From: "Kevin Buettner (Code Review)" To: gdb-patches@sourceware.org Message-ID: Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange Subject: [review] Add gdb_caching_proc support_nested_function_tests to lib/gdb.exp X-Gerrit-Change-Id: Ic2c93bc4cc200e07e104a2398f89a9c0514bdc75 X-Gerrit-Change-Number: 604 X-Gerrit-ChangeURL: X-Gerrit-Commit: c2a83e5206336a32b1238150b7295cf326c74173 References: Reply-To: kevinb@redhat.com, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-76-gf8b6da0ab5 Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/604 ...................................................................... Add gdb_caching_proc support_nested_function_tests to lib/gdb.exp This commit adds the gdb_caching_proc, support_nested_function_tests, to lib/gdb.exp. It tests to see whether or not the C compiler has support for nested function calls. gdb/testsuite/ChangeLog: * lib/gdb.exp (support_nested_function_tests): New proc. Change-Id: Ic2c93bc4cc200e07e104a2398f89a9c0514bdc75 --- M gdb/testsuite/lib/gdb.exp 1 file changed, 15 insertions(+), 0 deletions(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 1731a3e..31205c8 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -6385,6 +6385,21 @@ return $supports_schedule_locking } +# Return 1 if compiler supports use of nested functions. Otherwise, +# return 0. + +gdb_caching_proc support_nested_function_tests { + # Compile a test program containing a nested function + return [gdb_can_simple_compile nested_func { + int main () { + int foo () { + return 0; + } + return foo (); + } + } executable] +} + # gdb_target_symbol returns the provided symbol with the correct prefix # prepended. (See gdb_target_symbol_prefix, above.)