diff options
author | Tom de Vries <tom@codesourcery.com> | 2013-09-07 23:31:58 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2013-09-07 23:31:58 +0000 |
commit | e4fc429f7d3c308ed3075c0dc1839418188e4aa8 (patch) | |
tree | 657901c2804c84d827ed9a4e96b48bbde6b4ca2f /gcc | |
parent | 6df2ca09e94e60259ead0cc2b4bd07132674abbd (diff) | |
download | gcc-e4fc429f7d3c308ed3075c0dc1839418188e4aa8.zip gcc-e4fc429f7d3c308ed3075c0dc1839418188e4aa8.tar.gz gcc-e4fc429f7d3c308ed3075c0dc1839418188e4aa8.tar.bz2 |
Testcase for PR58282
2013-09-08 Tom de Vries <tom@codesourcery.com>
PR c++/58282
* g++.dg/tm/noexcept-6.C: New test.
From-SVN: r202360
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/tm/noexcept-6.C | 23 |
2 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e3b92b2..a9f6313 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-09-08 Tom de Vries <tom@codesourcery.com> + + PR c++/58282 + * g++.dg/tm/noexcept-6.C: New test. + 2013-09-06 Joern Rennecke <joern.rennecke@embecosm.com> * gcc.target/arc/cond-set-use.c: New test. diff --git a/gcc/testsuite/g++.dg/tm/noexcept-6.C b/gcc/testsuite/g++.dg/tm/noexcept-6.C new file mode 100644 index 0000000..4391159 --- /dev/null +++ b/gcc/testsuite/g++.dg/tm/noexcept-6.C @@ -0,0 +1,23 @@ +// { dg-do compile } +// { dg-options "-fno-exceptions -fgnu-tm -O -std=c++0x -fdump-tree-tmlower" } + +struct TrueFalse +{ + static constexpr bool v() { return true; } +}; + +int global; + +template<typename T> int foo() +{ + return __transaction_atomic noexcept(T::v()) (global + 1); +} + +int f1() +{ + return foo<TrueFalse>(); +} + +/* { dg-final { scan-tree-dump-times "eh_must_not_throw" 0 "tmlower" } } */ +/* { dg-final { scan-tree-dump-times "__transaction_atomic" 1 "tmlower" } } */ +/* { dg-final { cleanup-tree-dump "tmlower" } } */ |