summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.threads/print-threads.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.threads/print-threads.exp')
-rw-r--r--gdb/testsuite/gdb.threads/print-threads.exp38
1 files changed, 2 insertions, 36 deletions
diff --git a/gdb/testsuite/gdb.threads/print-threads.exp b/gdb/testsuite/gdb.threads/print-threads.exp
index 09c3f8ada80..60a106a050b 100644
--- a/gdb/testsuite/gdb.threads/print-threads.exp
+++ b/gdb/testsuite/gdb.threads/print-threads.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -38,41 +38,7 @@ set binfile ${objdir}/${subdir}/${testfile}
# carriage return)
set horiz "\[^\n\r\]*"
-set built_binfile 0
-
-# Default to the usual (only?) -lpthread on GNU/Linux to quiet noise
-if [istarget "*-*-linux*"] then {
- set possible_libs "-lpthread -lpthreads -lthread"
-} else {
- set possible_libs "-lpthreads -lpthread -lthread"
-}
-
-set why_msg "unrecognized error"
-foreach lib $possible_libs {
- set options "debug"
- lappend options "incdir=${objdir}/${subdir}"
- lappend options "libs=$lib"
- set ccout [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $options]
- switch -regexp -- $ccout {
- ".*no posix threads support.*" {
- set why_msg "missing threads include file"
- break
- }
- ".*cannot open -lpthread.*" {
- set why_msg "missing runtime threads library"
- }
- ".*Can't find library for -lpthread.*" {
- set why_msg "missing runtime threads library"
- }
- {^$} {
- pass "successfully compiled posix threads test case"
- set built_binfile 1
- break
- }
- }
-}
-if {$built_binfile == "0"} {
- unsupported "Couldn't compile ${srcfile}, ${why_msg}"
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
return -1
}