===================================================================
@@ -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 {} {
===================================================================
@@ -1,5 +1,6 @@
! { dg-do compile }
! { dg-options "-fgnu-tm" }
+! { dg-require-effective-target fgnu_tm }
program foo
real x
end program foo
===================================================================
@@ -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"
===================================================================
@@ -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));
===================================================================
@@ -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;
===================================================================
@@ -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
===================================================================
@@ -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 {
===================================================================
@@ -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 {