diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/tm/data-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/tm/data-2.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tm/data-2.c b/gcc/testsuite/gcc.dg/tm/data-2.c new file mode 100644 index 00000000000..3e2a604bfb3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tm/data-2.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-fgnu-tm" } */ +/* Test read and write on all basic types. */ + +struct S +{ + int x[10]; +}; + +static struct S g; + +extern void fill (struct S *); + +void f(void) +{ + struct S l; + fill(&l); + + __transaction_atomic { + g = l; + } +} |