aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/tm/pr46941.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/tm/pr46941.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/tm/pr46941.C37
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tm/pr46941.C b/gcc-4.9/gcc/testsuite/g++.dg/tm/pr46941.C
new file mode 100644
index 000000000..eac543831
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/tm/pr46941.C
@@ -0,0 +1,37 @@
+// { dg-do "compile" }
+// { dg-options "-fgnu-tm" }
+
+class Obj
+{
+ int dummy;
+};
+
+__attribute__((transaction_safe))
+Obj* allocate()
+{
+ return new Obj;
+}
+
+__attribute__((transaction_safe))
+void deallocate(Obj * o)
+{
+ delete o;
+}
+
+__attribute__((transaction_safe))
+Obj* allocatearray()
+{
+ return new Obj[2];
+}
+
+__attribute__((transaction_safe))
+void deallocatearray(Obj *o[])
+{
+ delete [] o;
+}
+
+/* The delete/new operators are handled by the libitm runtime. */
+/* { dg-final { scan-assembler "_ZGTtnw\[mj\]" } } */
+/* { dg-final { scan-assembler "_ZGTtna\[mj\]" } } */
+/* { dg-final { scan-assembler "_ZGTtdlPv" } } */
+/* { dg-final { scan-assembler "_ZGTtdaPv" } } */