summaryrefslogtreecommitdiff
path: root/libitm/testsuite/libitm.c/clone-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'libitm/testsuite/libitm.c/clone-1.c')
-rw-r--r--libitm/testsuite/libitm.c/clone-1.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libitm/testsuite/libitm.c/clone-1.c b/libitm/testsuite/libitm.c/clone-1.c
new file mode 100644
index 00000000000..03e62664d80
--- /dev/null
+++ b/libitm/testsuite/libitm.c/clone-1.c
@@ -0,0 +1,28 @@
+/* Verify that we can look up tm clone of transaction_callable
+ and transaction_pure. */
+
+#include <stdlib.h>
+#include <libitm.h>
+
+static int x;
+
+int __attribute__((transaction_pure)) pure(int i)
+{
+ return i+2;
+}
+
+int __attribute__((transaction_callable)) callable(void)
+{
+ return ++x;
+}
+
+int main()
+{
+ if (_ITM_getTMCloneSafe (&pure) != &pure)
+ abort ();
+
+ if (_ITM_getTMCloneSafe (&callable) == NULL)
+ abort ();
+
+ return 0;
+}