Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Sourceware to Gerrit sync (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: Kevin Buettner <kevinb@redhat.com>,
	Pedro Alves <palves@redhat.com>,
	Tom Tromey <tromey@sourceware.org>,
	gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: [pushed] Add gdb_compile_openmp to lib/gdb.exp
Date: Tue, 10 Dec 2019 22:46:00 -0000	[thread overview]
Message-ID: <20191210224607.6F6F620AF6@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1572841567000.I94048b8b0940c707ce0529a6bcfa6e4eace49101@gnutoolchain-gerrit.osci.io>

The original change was created by Kevin Buettner.

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  <kevinb@redhat.com>
+
+            * 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  <tromey@adacore.com>
 
 	* 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
 	    }

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I94048b8b0940c707ce0529a6bcfa6e4eace49101
Gerrit-Change-Number: 503
Gerrit-PatchSet: 3
Gerrit-Owner: Kevin Buettner <kevinb@redhat.com>
Gerrit-Reviewer: Kevin Buettner <kevinb@redhat.com>
Gerrit-Reviewer: Pedro Alves <palves@redhat.com>
Gerrit-Reviewer: Tom Tromey <tromey@sourceware.org>
Gerrit-CC: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-MessageType: newpatchset


      parent reply	other threads:[~2019-12-10 22:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-04  4:26 [review] " Kevin Buettner (Code Review)
2019-11-05 15:27 ` Tom Tromey (Code Review)
2019-11-06  0:33 ` Pedro Alves (Code Review)
2019-11-06 16:09 ` Simon Marchi (Code Review)
2019-11-06 16:19 ` Pedro Alves (Code Review)
2019-11-06 16:24 ` Pedro Alves (Code Review)
2019-11-06 16:26   ` Simon Marchi
2019-11-06 16:31     ` Pedro Alves
2019-11-06 16:28   ` Simon Marchi
2019-11-06 16:29 ` Simon Marchi (Code Review)
2019-11-06 23:05 ` Kevin Buettner (Code Review)
2019-11-08 15:06   ` Pedro Alves
2019-11-06 23:14 ` Kevin Buettner (Code Review)
2019-11-09 20:59 ` [review v2] " Kevin Buettner (Code Review)
2019-12-03 16:41 ` Pedro Alves (Code Review)
2019-12-10 22:46 ` [pushed] " Sourceware to Gerrit sync (Code Review)
2019-12-10 22:46 ` Sourceware to Gerrit sync (Code Review) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191210224607.6F6F620AF6@gnutoolchain-gerrit.osci.io \
    --to=gerrit@gnutoolchain-gerrit.osci.io \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.com \
    --cc=noreply@gnutoolchain-gerrit.osci.io \
    --cc=palves@redhat.com \
    --cc=simon.marchi@polymtl.ca \
    --cc=tromey@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox