+2013-04-15 Siva Chandra Reddy <sivachandra@google.com>
+
+ Add option to link testcases with Pthreads library when
+ using 'prepare_for_testing' in tests.
+
+ * lib/gdb.exp (build_executable_from_specs): Use
+ gdb_compile_pthreads to compile if option "pthreads" is
+ specified.
+
2013-04-15 Tom Tromey <tromey@redhat.com>
* gdb.cp/exceptprint.exp: Add regexp catchpoint tests.
# different options to be passed to different sub-compilations.
# TESTNAME is the name of the test; this is passed to 'untested' if
# something fails.
-# OPTIONS is passed to the final link, using gdb_compile.
+# OPTIONS is passed to the final link, using gdb_compile. If OPTIONS
+# contains the option "pthreads", then gdb_compile_pthreads is used.
# ARGS is a flat list of source specifications, of the form:
# { SOURCE1 OPTIONS1 [ SOURCE2 OPTIONS2 ]... }
# Each SOURCE is compiled to an object file using its OPTIONS,
lappend objects "${binfile}${i}.o"
incr i
}
-
- if { [gdb_compile $objects "${binfile}" executable $options] != "" } {
- untested $testname
- return -1
+
+ set pthreads [lsearch -exact $options "pthreads"]
+ if { $pthreads >= 0 } {
+ set options [lreplace $options $pthreads $pthreads]
+ if { [gdb_compile_pthreads $objects "${binfile}" executable $options] != "" } {
+ untested $testname
+ return -1
+ }
+ } else {
+ if { [gdb_compile $objects "${binfile}" executable $options] != "" } {
+ untested $testname
+ return -1
+ }
}
set info_options ""