| 1 |
// { dg-do compile { target c++11 } } |
| 2 |
// { dg-options "-fno-exceptions -fgnu-tm -O -fdump-tree-tmlower" } |
| 3 |
|
| 4 |
struct TrueFalse |
| 5 |
{ |
| 6 |
static constexpr bool v() { return true; } |
| 7 |
}; |
| 8 |
|
| 9 |
int global; |
| 10 |
|
| 11 |
template<typename T> int foo() |
| 12 |
{ |
| 13 |
return __transaction_atomic noexcept(T::v()) (global + 1); |
| 14 |
} |
| 15 |
|
| 16 |
int f1() |
| 17 |
{ |
| 18 |
return foo<TrueFalse>(); |
| 19 |
} |
| 20 |
|
| 21 |
/* { dg-final { scan-tree-dump-times "eh_must_not_throw" 0 "tmlower" } } */ |
| 22 |
/* { dg-final { scan-tree-dump-times "__transaction_atomic" 1 "tmlower" } } */ |