From patchwork Sat Nov 9 20:59:03 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: 35768 Received: (qmail 119336 invoked by alias); 9 Nov 2019 20:59:11 -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 119315 invoked by uid 89); 9 Nov 2019 20:59:11 -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=HX-Languages-Length:2399, lindex, sk:i94048b, binfile 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:09 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 9F82321080; Sat, 9 Nov 2019 15:59:06 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id 6D01B20387; 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 4AACC2816F; Sat, 9 Nov 2019 15:59:04 -0500 (EST) X-Gerrit-PatchSet: 2 Date: Sat, 9 Nov 2019 15:59:03 -0500 From: "Kevin Buettner (Code Review)" To: Tom Tromey , gdb-patches@sourceware.org Cc: Pedro Alves , Simon Marchi Auto-Submitted: auto-generated X-Gerrit-MessageType: newpatchset Subject: [review v2] Add gdb_compile_openmp to lib/gdb.exp X-Gerrit-Change-Id: I94048b8b0940c707ce0529a6bcfa6e4eace49101 X-Gerrit-Change-Number: 503 X-Gerrit-ChangeURL: X-Gerrit-Commit: 71fa19bec1ddf265c60fc479f41ee6df7e7ce290 In-Reply-To: References: Reply-To: kevinb@redhat.com, simon.marchi@polymtl.ca, tromey@sourceware.org, palves@redhat.com, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-76-gf8b6da0ab5 Message-Id: <20191109205904.4AACC2816F@gnutoolchain-gerrit.osci.io> 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. Change-Id: I94048b8b0940c707ce0529a6bcfa6e4eace49101 --- M gdb/testsuite/lib/gdb.exp 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 2d395ef..1731a3e 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -3941,6 +3941,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 ""} { @@ -4146,6 +4149,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 @@ -5891,7 +5902,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]" } @@ -5926,7 +5937,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 }