Add gdb_compile_openmp to lib/gdb.exp
authorKevin Buettner <kevinb@redhat.com>
Thu, 22 Aug 2019 02:32:12 +0000 (19:32 -0700)
committerKevin Buettner <kevinb@redhat.com>
Tue, 10 Dec 2019 22:37:46 +0000 (15:37 -0700)
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

gdb/testsuite/ChangeLog
gdb/testsuite/lib/gdb.exp

index 52edbc13083df2cfc6387dc9b33014eea42043f7..d3510d42cbc2f4bfef075c27a6e4ddd95ca27761 100644 (file)
@@ -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.
index aa774462d25f51d2186eb98227350d18ca5544ed..806e5a0c304e8b130909fd854f3fcd6ab07f5317 100644 (file)
@@ -3951,6 +3951,9 @@ proc gdb_compile {source dest type options} {
 # 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 @@ proc gdb_compile_objc {source dest type options} {
     }
 }
 
+# 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 @@ proc build_executable_from_specs {testname executable options args} {
     }
 
     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 @@ proc build_executable_from_specs {testname executable options args} {
            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
            }
This page took 0.033248 seconds and 4 git commands to generate.