Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [review] Add gdb_compile_openmp to lib/gdb.exp
@ 2019-11-04  4:26 Kevin Buettner (Code Review)
  2019-11-05 15:27 ` Tom Tromey (Code Review)
                   ` (11 more replies)
  0 siblings, 12 replies; 17+ messages in thread
From: Kevin Buettner (Code Review) @ 2019-11-04  4:26 UTC (permalink / raw)
  To: gdb-patches

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

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I94048b8b0940c707ce0529a6bcfa6e4eace49101
Gerrit-Change-Number: 503
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Buettner <kevinb@redhat.com>
Gerrit-MessageType: newchange


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2019-12-10 22:46 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-04  4:26 [review] Add gdb_compile_openmp to lib/gdb.exp 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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox