> From: Hans-Peter Nilsson <h...@bitrange.com>
> Date: Tue, 14 Feb 2012 03:30:44 +0100

> you need to gate *all* tm-related
> tests on something like check_effective_target_pthread.

Like this, tested cris-elf, fixes the regressions, does the same
as -fopenmp.

Ok?

gcc/testsuite:

        * lib/target-supports.exp (check_effective_target_fgnu_tm): New
        proc.
        * gfortran.dg/trans-mem-skel.f90: Gate test on effective_target
        fgnu_tm. 
        * gcc.dg/lto/trans-mem-1_0.c, gcc.dg/lto/trans-mem-2_0.c,
        gcc.dg/lto/trans-mem-3_0.c, gcc.dg/lto/trans-mem-4_0.c: Ditto.
        * gcc.dg/tm/tm.exp: Gate the whole of gcc.dg/tm on
        effective_target fgnu_tm.
        * g++.dg/tm/tm.exp: Ditto for g++.dg/tm.


Index: lib/target-supports.exp
===================================================================
--- lib/target-supports.exp     (revision 184203)
+++ lib/target-supports.exp     (working copy)
@@ -716,6 +716,15 @@ proc check_effective_target_fopenmp {} {
     } "-fopenmp"]
 }
 
+# Return 1 if compilation with -fgnu-tm is error-free for trivial
+# code, 0 otherwise.
+
+proc check_effective_target_fgnu_tm {} {
+    return [check_no_compiler_messages fgnu_tm object {
+       void foo (void) { }
+    } "-fgnu-tm"]
+}
+
 # Return 1 if the target supports mmap, 0 otherwise.
 
 proc check_effective_target_mmap {} {
Index: gfortran.dg/trans-mem-skel.f90
===================================================================
--- gfortran.dg/trans-mem-skel.f90      (revision 184203)
+++ gfortran.dg/trans-mem-skel.f90      (working copy)
@@ -1,5 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-fgnu-tm" }
+! { dg-require-effective-target fgnu_tm }
 program foo
       real x
 end program foo
Index: gcc.dg/lto/trans-mem-2_0.c
===================================================================
--- gcc.dg/lto/trans-mem-2_0.c  (revision 184203)
+++ gcc.dg/lto/trans-mem-2_0.c  (working copy)
@@ -1,6 +1,7 @@
 /* { dg-lto-options {{-flto -fgnu-tm}} } */
 /* { dg-lto-do link } */
 /* { dg-require-effective-target stdint_types } */
+/* { dg-require-effective-target fgnu_tm } */
 
 #include "trans-mem.h"
 
Index: gcc.dg/lto/trans-mem-4_0.c
===================================================================
--- gcc.dg/lto/trans-mem-4_0.c  (revision 184203)
+++ gcc.dg/lto/trans-mem-4_0.c  (working copy)
@@ -1,6 +1,7 @@
 /* { dg-lto-options {{-flto -fgnu-tm}} } */
 /* { dg-lto-do link } */
 /* { dg-require-effective-target stdint_types } */
+/* { dg-require-effective-target fgnu_tm } */
 
 extern void foo() __attribute__((transaction_safe));
 
Index: gcc.dg/lto/trans-mem-1_0.c
===================================================================
--- gcc.dg/lto/trans-mem-1_0.c  (revision 184203)
+++ gcc.dg/lto/trans-mem-1_0.c  (working copy)
@@ -1,6 +1,7 @@
 /* { dg-lto-options {{-flto -fgnu-tm}} } */
 /* { dg-lto-do link } */
 /* { dg-require-effective-target stdint_types } */
+/* { dg-require-effective-target fgnu_tm } */
 
 int i;
 
Index: gcc.dg/lto/trans-mem-3_0.c
===================================================================
--- gcc.dg/lto/trans-mem-3_0.c  (revision 184203)
+++ gcc.dg/lto/trans-mem-3_0.c  (working copy)
@@ -1,6 +1,7 @@
 /* { dg-lto-options {{-flto}} } */
 /* { dg-lto-do link } */
 /* { dg-require-effective-target stdint_types } */
+/* { dg-require-effective-target fgnu_tm } */
 
 /* Test that we can build one object file with -fgnu-tm
    (trans-mem-3_1.c), but do the final link of all objects without
Index: gcc.dg/tm/tm.exp
===================================================================
--- gcc.dg/tm/tm.exp    (revision 184203)
+++ gcc.dg/tm/tm.exp    (working copy)
@@ -19,6 +19,10 @@
 # Load support procs.
 load_lib gcc-dg.exp
 
+if ![check_effective_target_fgnu_tm] {
+  return
+}
+
 # If a testcase doesn't have special options, use these.
 global DEFAULT_CFLAGS
 if ![info exists DEFAULT_CFLAGS] then {
Index: g++.dg/tm/tm.exp
===================================================================
--- g++.dg/tm/tm.exp    (revision 184203)
+++ g++.dg/tm/tm.exp    (working copy)
@@ -19,6 +19,10 @@
 # Load support procs.
 load_lib g++-dg.exp
 
+if ![check_effective_target_fgnu_tm] {
+  return
+}
+
 # If a testcase doesn't have special options, use these.
 global DEFAULT_CXXFLAGS
 if ![info exists DEFAULT_CXXFLAGS] then {

brgds, H-P

Reply via email to