summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/tm/template-2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/tm/template-2.C')
-rw-r--r--gcc/testsuite/g++.dg/tm/template-2.C22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/tm/template-2.C b/gcc/testsuite/g++.dg/tm/template-2.C
new file mode 100644
index 00000000000..53870246a58
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tm/template-2.C
@@ -0,0 +1,22 @@
+// { dg-do compile }
+// { dg-options "-fgnu-tm -O -std=c++0x -fdump-tree-tmmark" }
+
+struct TrueFalse
+{
+};
+
+int global;
+
+template<typename T> int foo()
+{
+ return __transaction_atomic (global + 2)
+ + __transaction_atomic (global + 3);
+}
+
+int f1()
+{
+ return foo<TrueFalse>();
+}
+
+/* { dg-final { scan-tree-dump-times "ITM_RU" 2 "tmmark" } } */
+/* { dg-final { cleanup-tree-dump "tmmark" } } */