+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.
# 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 ""} {
}
}
+# 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
}
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]"
}
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
}