From patchwork Mon Nov 4 04:26: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: 35602 Received: (qmail 120172 invoked by alias); 4 Nov 2019 04:26:12 -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 120163 invoked by uid 89); 4 Nov 2019 04:26:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.3 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=fopenmp, 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; Mon, 04 Nov 2019 04:26:10 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 2CDC320407; Sun, 3 Nov 2019 23:26: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 D715820322 for ; Sun, 3 Nov 2019 23:26:07 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id B4D9425B28 for ; Sun, 3 Nov 2019 23:26:07 -0500 (EST) X-Gerrit-PatchSet: 1 Date: Sun, 3 Nov 2019 23:26:07 -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_compile_openmp to lib/gdb.exp X-Gerrit-Change-Id: I94048b8b0940c707ce0529a6bcfa6e4eace49101 X-Gerrit-Change-Number: 503 X-Gerrit-ChangeURL: X-Gerrit-Commit: d50e7cd8527c61b307f06a048dcfb6e8647b9149 References: Reply-To: kevinb@redhat.com, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-75-g9005159e5d 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, 24 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 2d395ef..48d19f9 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4146,6 +4146,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 +5899,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]" } @@ -5919,6 +5927,21 @@ } } set ret [gdb_compile_rust $sources_path "${binfile}" $options] + } elseif [string match gdb_compile_openmp $func] { + set objects {} + set i 0 + foreach {s local_options} $args { + if { ! [regexp "^/" "$s"] } then { + set s "$srcdir/$subdir/$s" + } + if { [$func "${s}" "${binfile}${i}.o" object $local_options] != "" } { + untested $testname + return -1 + } + lappend objects "${binfile}${i}.o" + incr i + } + set ret [$func $objects "${binfile}" executable $options] } else { set objects {} set i 0