aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tm/20100519.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tm/20100519.c')
-rw-r--r--gcc/testsuite/gcc.dg/tm/20100519.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tm/20100519.c b/gcc/testsuite/gcc.dg/tm/20100519.c
new file mode 100644
index 00000000000..009b7901a39
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tm/20100519.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O" } */
+
+typedef struct coordinate {
+ double x;
+} coordinate_t;
+
+coordinate_t elementPtrC[3];
+
+__attribute__((transaction_safe))
+void TMelement_alloc (coordinate_t* coordinates, int numCoordinate)
+{
+ int i;
+ for (i = 0; i < numCoordinate; i++) {
+ elementPtrC[i] = coordinates[i];
+ }
+}