diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/tm')
-rw-r--r-- | gcc/testsuite/gcc.dg/tm/memopt-13.c | 15 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tm/memopt-6.c | 6 |
2 files changed, 19 insertions, 2 deletions
diff --git a/gcc/testsuite/gcc.dg/tm/memopt-13.c b/gcc/testsuite/gcc.dg/tm/memopt-13.c new file mode 100644 index 00000000000..9b7e5e5d153 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tm/memopt-13.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-fgnu-tm -O -fdump-tree-tmmark" } */ + +struct large { int x[100]; }; +struct large large_global; +extern struct large function (void) __attribute__((transaction_safe)); + +void f() +{ + __transaction { + large_global = function(); + } +} + +/* { dg-final { scan-tree-dump-times "memmoveRtWt \\\(&large_global," 1 "tmmark" } } */ diff --git a/gcc/testsuite/gcc.dg/tm/memopt-6.c b/gcc/testsuite/gcc.dg/tm/memopt-6.c index 80ec56cd065..5bd0918c584 100644 --- a/gcc/testsuite/gcc.dg/tm/memopt-6.c +++ b/gcc/testsuite/gcc.dg/tm/memopt-6.c @@ -6,13 +6,15 @@ struct large bark(); extern int test (void) __attribute__((transaction_safe)); struct large lacopy; -int f() /* { dg-message "unimplemented: transactional load" } */ +int f() { int i = readint(); struct large lala = bark(); __transaction { lala.x[55] = 666; - lala = lacopy; + lala = lacopy; /* Aggregate instrumentation. */ } return lala.x[i]; } + +/* { dg-final { scan-tree-dump-times "memmoveRtWt \\\(&lala, &lacopy" 1 "tmedge" } } */ |