From patchwork Tue Dec 10 22:46:07 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: 36700 Received: (qmail 90188 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 90099 invoked by uid 89); 10 Dec 2019 22:46:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=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 7243320456; Tue, 10 Dec 2019 17:46:11 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [IPv6:2620:52:3:1:5054:ff:fe06:16ca]) by mx1.osci.io (Postfix) with ESMTP id C97372039A; 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 AEF5B25BB4; Tue, 10 Dec 2019 17:46:07 -0500 (EST) X-Gerrit-PatchSet: 3 Date: Tue, 10 Dec 2019 17:46:07 -0500 From: "Sourceware to Gerrit sync (Code Review)" To: Kevin Buettner , gdb-patches@sourceware.org Cc: Pedro Alves , Simon Marchi , Tom Tromey Auto-Submitted: auto-generated X-Gerrit-MessageType: merged Subject: [pushed] Add gdb_compile_openmp to lib/gdb.exp X-Gerrit-Change-Id: I94048b8b0940c707ce0529a6bcfa6e4eace49101 X-Gerrit-Change-Number: 503 X-Gerrit-ChangeURL: X-Gerrit-Commit: 26b911fb6411c930cf408a82604dc4355c086e03 In-Reply-To: References: Reply-To: noreply@gnutoolchain-gerrit.osci.io, simon.marchi@polymtl.ca, tromey@sourceware.org, 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.AEF5B25BB4@gnutoolchain-gerrit.osci.io> Sourceware to Gerrit sync has submitted this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/503 ...................................................................... Add gdb_compile_openmp to lib/gdb.exp gdb/testsuite/ChangeLog: * lib/gdb.exp (gdb_compile_openmp): New proc. (build_executable_from_specs): Add an "openmp" option. (gdb_compile_pthreads): Add non-executable case. Change-Id: I94048b8b0940c707ce0529a6bcfa6e4eace49101 --- M gdb/testsuite/ChangeLog M gdb/testsuite/lib/gdb.exp 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 52edbc1..d3510d4 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +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 * gdb.ada/unchecked_union.exp: New file. diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index aa77446..806e5a0 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -3951,6 +3951,9 @@ # against several different thread libraries, to see which one this # system has. proc gdb_compile_pthreads {source dest type options} { + if {$type != "executable"} { + return [gdb_compile $source $dest $type $options] + } set built_binfile 0 set why_msg "unrecognized error" foreach lib {-lpthreads -lpthread -lthread ""} { @@ -4156,6 +4159,14 @@ } } +# Build an OpenMP program from SOURCE. See prefatory comment for +# gdb_compile, above, for discussion of the parameters to this proc. + +proc gdb_compile_openmp {source dest type options} { + lappend options "additional_flags=-fopenmp" + return [gdb_compile $source $dest $type $options] +} + # Send a command to GDB. # For options for TYPE see gdb_stdin_log_write @@ -5901,7 +5912,7 @@ } set func gdb_compile - set func_index [lsearch -regexp $options {^(pthreads|shlib|shlib_pthreads)$}] + set func_index [lsearch -regexp $options {^(pthreads|shlib|shlib_pthreads|openmp)$}] if {$func_index != -1} { set func "${func}_[lindex $options $func_index]" } @@ -5936,7 +5947,7 @@ if { ! [regexp "^/" "$s"] } then { set s "$srcdir/$subdir/$s" } - if { [gdb_compile "${s}" "${binfile}${i}.o" object $local_options] != "" } { + if { [$func "${s}" "${binfile}${i}.o" object $local_options] != "" } { untested $testname return -1 }