From patchwork Tue Dec 10 22:46:06 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: 36698 Received: (qmail 90209 invoked by alias); 10 Dec 2019 22:46:17 -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 90126 invoked by uid 89); 10 Dec 2019 22:46:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.6 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= 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; Tue, 10 Dec 2019 22:46:15 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id B0DE520484; Tue, 10 Dec 2019 17:46:12 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id DE351202E5; Tue, 10 Dec 2019 17:46:07 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id C36AB28175; Tue, 10 Dec 2019 17:46:07 -0500 (EST) X-Gerrit-PatchSet: 2 Date: Tue, 10 Dec 2019 17:46:06 -0500 From: "Sourceware to Gerrit sync (Code Review)" To: Kevin Buettner , Pedro Alves , gdb-patches@sourceware.org Auto-Submitted: auto-generated X-Gerrit-MessageType: newpatchset Subject: [pushed] 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: bb47f919bfdb8908361de74a0daf1af208ae425b In-Reply-To: References: Reply-To: noreply@gnutoolchain-gerrit.osci.io, palves@redhat.com, kevinb@redhat.com, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Message-Id: <20191210224607.C36AB28175@gnutoolchain-gerrit.osci.io> The original change was created by Kevin Buettner. 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/ChangeLog M gdb/testsuite/lib/gdb.exp 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index d3510d4..4b2e132 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,8 +1,12 @@ 2019-12-10 Kevin Buettner - * lib/gdb.exp (gdb_compile_openmp): New proc. - (build_executable_from_specs): Add an "openmp" option. - (gdb_compile_pthreads): Add non-executable case. + * lib/gdb.exp (support_nested_function_tests): New proc. + +2019-12-10 Kevin Buettner + + * lib/gdb.exp (gdb_compile_openmp): New proc. + (build_executable_from_specs): Add an "openmp" option. + (gdb_compile_pthreads): Add non-executable case. 2019-12-10 Tom Tromey diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 806e5a0..8b1ec62 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -6395,6 +6395,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.)