Mercurial > hg > CbC > CbC_gcc
annotate libitm/testsuite/libitm.c++/eh-4.C @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // Test that throwing out of an atomic_commit block commits the transaction. |
2 | |
3 // { dg-do run } | |
4 // { dg-options "-fgnu-tm" } | |
5 | |
6 int main() | |
7 { | |
8 static int i; | |
9 bool caught = false; | |
10 try { | |
11 atomic_commit { | |
12 i = 12; | |
13 throw 42; | |
14 i = 24; | |
15 } | |
16 } catch (int x) { | |
17 caught = (x == 42); | |
18 } | |
19 if (!caught || i != 12) | |
20 __builtin_abort(); | |
21 } |