aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2006-01-23 23:44:16 +0000
committerHans-Peter Nilsson <hp@gcc.gnu.org>2006-01-23 23:44:16 +0000
commita782ee4583f2ba7ed58316876df076acbae61100 (patch)
tree08428cb2217ff983df10d217c8dc57f351b86337
parent839009978ae5e2e4f30057e2cdfd925a05c9cc95 (diff)
downloadgcc-a782ee4583f2ba7ed58316876df076acbae61100.zip
gcc-a782ee4583f2ba7ed58316876df076acbae61100.tar.gz
gcc-a782ee4583f2ba7ed58316876df076acbae61100.tar.bz2
re PR testsuite/25891 (gomp tests run on non-libgomp (non-thread) ports, failing all)
PR testsuite/25891 * lib/target-supports.exp (check_effective_target_fopenmp): New proc. * gcc.dg/gomp/gomp.exp: Return without testing anything if check_effective_target_fopenmp returns 0. From-SVN: r110148
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gcc.dg/gomp/gomp.exp4
-rw-r--r--gcc/testsuite/lib/target-supports.exp35
3 files changed, 46 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 954772f..aa0ed47 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2006-01-24 Hans-Peter Nilsson <hp@axis.com>
+
+ PR testsuite/25891
+ * lib/target-supports.exp (check_effective_target_fopenmp): New proc.
+ * gcc.dg/gomp/gomp.exp: Return without testing anything if
+ check_effective_target_fopenmp returns 0.
+
2006-01-23 Eric Botcazou <ebotcazou@adacore.com>
PR ada/20548
diff --git a/gcc/testsuite/gcc.dg/gomp/gomp.exp b/gcc/testsuite/gcc.dg/gomp/gomp.exp
index cb1b338..7ce426d 100644
--- a/gcc/testsuite/gcc.dg/gomp/gomp.exp
+++ b/gcc/testsuite/gcc.dg/gomp/gomp.exp
@@ -3,6 +3,10 @@
# Load support procs.
load_lib gcc-dg.exp
+if ![check_effective_target_fopenmp] {
+ return
+}
+
# Initialize `dg'.
dg-init
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 05a180e..851218f 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -468,6 +468,41 @@ proc check_effective_target_tls_runtime {} {
return $et_tls_runtime_saved
}
+# Return 1 if compilation with -fopenmp is error-free for trivial
+# code, 0 otherwise.
+
+proc check_effective_target_fopenmp {} {
+ global et_fopenmp_saved
+ global et_fopenmp_target_name
+
+ if { ![info exists et_fopenmp_target_name] } {
+ set et_fopenmp_target_name ""
+ }
+
+ # If the target has changed since we set the cached value, clear it.
+ set current_target [current_target_name]
+ if { $current_target != $et_fopenmp_target_name } {
+ verbose "check_effective_target_fopenmp: `$et_fopenmp_target_name'" 2
+ set et_fopenmp_target_name $current_target
+ if [info exists et_fopenmp_saved] {
+ verbose "check_effective_target_fopenmp: removing cached result" 2
+ unset et_fopenmp_saved
+ }
+ }
+
+ if [info exists et_fopenmp_saved] {
+ verbose "check_effective_target_fopenmp: using cached result" 2
+ } else {
+ verbose "check_effective_target_fopenmp: compiling source" 2
+
+ set et_fopenmp_saved [string match "" [get_compiler_messages fopenmp object {
+ void foo (void) { }
+ } "-fopenmp"]]
+ }
+ verbose "check_effective_target_fopenmp: returning $et_fopenmp_saved" 2
+ return $et_fopenmp_saved
+}
+
# Return 1 if -fpic and -fPIC are supported, as in no warnings or errors
# emitted, 0 otherwise. Whether a shared library can actually be built is
# out of scope for this test.