Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/tm/unsafe1.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // Transaction-unsafe testcase from TM TS. |
2 // { dg-options -fgnu-tm } | |
3 | |
4 struct S { | |
5 virtual ~S(); | |
6 }; | |
131 | 7 void f() transaction_safe { |
111 | 8 S s; // { dg-error "unsafe" "invocation of unsafe destructor" } |
9 } | |
10 | |
11 int g(int x) { // is transaction-safe | |
12 if (x <= 0) | |
13 return 0; | |
14 return x + g(x-1); | |
15 } |