diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/tm/malloc.c')
-rw-r--r-- | gcc-4.9/gcc/testsuite/c-c++-common/tm/malloc.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/tm/malloc.c b/gcc-4.9/gcc/testsuite/c-c++-common/tm/malloc.c new file mode 100644 index 000000000..81bcc56fc --- /dev/null +++ b/gcc-4.9/gcc/testsuite/c-c++-common/tm/malloc.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-options "-fgnu-tm -fdump-tree-tmmark" } */ + +#include <stdlib.h> + +char *z; + +void foobar(void) +{ + char *p, *q; + __transaction_atomic { + p = (char *)malloc(123); + q = (char *)calloc(555,1); + free(q); + free(p); + } + z = (char *)malloc (666); +} + +/* { dg-final { scan-tree-dump-times " malloc .666" 1 "tmmark" { target { ! { *-*-solaris2* && c++ } } } } } */ +/* Solaris 2 headers are C++-aware and declare std::malloc. */ +/* { dg-final { scan-tree-dump-times " std::malloc .666" 1 "tmmark" { target { *-*-solaris2* && c++ } } } } */ +/* { dg-final { scan-tree-dump-times "__builtin__ITM_malloc" 1 "tmmark" } } */ +/* { dg-final { scan-tree-dump-times "__builtin__ITM_calloc" 1 "tmmark" } } */ +/* { dg-final { scan-tree-dump-times "__builtin__ITM_free" 2 "tmmark" } } */ +/* { dg-final { cleanup-tree-dump "tmmark" } } */ |