From bdd07b44ffe70f2d6f3c76b1563e7cb4f2c42336 Mon Sep 17 00:00:00 2001 From: torvald Date: Tue, 15 Nov 2011 12:16:13 +0000 Subject: Require parentheses when parsing transaction expressions. gcc/ * c-parser.c (c_parser_transaction_expression): Require parentheses when parsing transaction expressions. gcc/cp/ * parser.c (cp_parser_transaction_expression): Require parentheses when parsing transaction expressions. gcc/testsuite/ * c-c++-common/tm/trxn-expr-3.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181383 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/c-c++-common/tm/trxn-expr-3.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 gcc/testsuite/c-c++-common/tm/trxn-expr-3.c (limited to 'gcc/testsuite/c-c++-common/tm') diff --git a/gcc/testsuite/c-c++-common/tm/trxn-expr-3.c b/gcc/testsuite/c-c++-common/tm/trxn-expr-3.c new file mode 100644 index 00000000000..0a87780f17e --- /dev/null +++ b/gcc/testsuite/c-c++-common/tm/trxn-expr-3.c @@ -0,0 +1,14 @@ +// { dg-do compile } +// { dg-options "-fgnu-tm -O -fdump-tree-tmmark" } + +int global; + +int f2() +{ + return __transaction_atomic (global + 3) + + __transaction_atomic (global + 4); +} + +/* { dg-final { scan-tree-dump-times "ITM_RU" 2 "tmmark" } } */ +/* { dg-final { scan-tree-dump-times "ITM_commitTransaction" 2 "tmmark" } } */ +/* { dg-final { cleanup-tree-dump "tmmark" } } */ -- cgit v1.2.1 From 589005b4bbefd4a28332e79e6741e827ec26169e Mon Sep 17 00:00:00 2001 From: ro Date: Mon, 21 Nov 2011 14:28:49 +0000 Subject: Adapt c-c++-common/tm/malloc.c for Solaris headers with C++ * c-c++-common/tm/malloc.c: Scan tree dumps for std::malloc if *-*-solaris2* && c++. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181579 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/c-c++-common/tm/malloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gcc/testsuite/c-c++-common/tm') diff --git a/gcc/testsuite/c-c++-common/tm/malloc.c b/gcc/testsuite/c-c++-common/tm/malloc.c index de7a766e36c..81bcc56fc41 100644 --- a/gcc/testsuite/c-c++-common/tm/malloc.c +++ b/gcc/testsuite/c-c++-common/tm/malloc.c @@ -17,7 +17,9 @@ void foobar(void) z = (char *)malloc (666); } -/* { dg-final { scan-tree-dump-times " malloc .666" 1 "tmmark" } } */ +/* { 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" } } */ -- cgit v1.2.1