aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/tm/pr47746.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/tm/pr47746.C')
-rw-r--r--gcc/testsuite/g++.dg/tm/pr47746.C27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/tm/pr47746.C b/gcc/testsuite/g++.dg/tm/pr47746.C
new file mode 100644
index 00000000000..7cd9e1006d1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tm/pr47746.C
@@ -0,0 +1,27 @@
+// { dg-do compile }
+// { dg-options "-fgnu-tm" }
+
+class InputStream
+{
+ public:
+ virtual unsigned int readUint32 () = 0;
+};
+
+class Building
+{
+ public:
+ __attribute__((transaction_safe)) Building (InputStream *stream);
+ __attribute__((transaction_safe)) void freeGradients ();
+ void load (InputStream *stream);
+};
+
+Building::Building (InputStream *stream)
+{
+ load(stream);
+}
+
+void Building::load (InputStream *stream)
+{
+ int j = (int)stream->readUint32 ();
+ freeGradients ();
+}