diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/tm/props-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/tm/props-2.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tm/props-2.c b/gcc/testsuite/gcc.dg/tm/props-2.c new file mode 100644 index 00000000000..56a3ffa1367 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tm/props-2.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-fgnu-tm -fdump-ipa-tmipa" } */ + +/* Test that irrevocability gets set for the obvious case. */ + +int global; +int george; + +extern crap() __attribute__((transaction_unsafe)); + +foo(){ + __transaction_relaxed { + global++; + crap(); + george++; + } +} + +/* { dg-final { scan-ipa-dump-times "GTMA_MAY_ENTER_IRREVOCABLE" 1 "tmipa" } } */ +/* { dg-final { cleanup-ipa-dump "tmipa" } } */ |