blob: dcbd3d8ee9c6736ec67244e4f4d1677d88772776 [file] [log] [blame]
// { dg-do compile { target c++11 } }
// { dg-options "-fgnu-tm -O -fdump-tree-tmmark -fdump-tree-tmlower" }
struct TrueFalse
{
static constexpr bool v() { return true; }
};
int global;
template<typename T> int foo()
{
__transaction_atomic noexcept(T::v()) { global += 1; }
return __transaction_atomic noexcept(T::v()) (global + 2);
}
int f1()
{
return foo<TrueFalse>();
}
int f2()
{
return __transaction_atomic noexcept(true) (global + 3)
+ __transaction_atomic noexcept(TrueFalse::v()) (global + 4);
}
int f3()
{
__transaction_atomic noexcept(true) { global += 5; }
__transaction_atomic noexcept(TrueFalse::v()) { global += 6; }
return global;
}
/* { dg-final { scan-tree-dump-times "eh_must_not_throw" 12 "tmlower" } } */
/* { dg-final { scan-tree-dump-times "ITM_RU" 6 "tmmark" } } */