Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/tm/memopt-4.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 (2017-10-27) |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* { dg-do compile } */ | |
2 /* { dg-options "-fgnu-tm -O -fdump-tree-tmedge" } */ | |
3 | |
4 /* Test thread-local memory optimizations: save/restore pairs. */ | |
5 | |
6 struct large { int x[100]; }; | |
7 struct large bark(); | |
8 extern int test (void) __attribute__((transaction_safe)); | |
9 extern int readint (void); | |
10 | |
11 int f() | |
12 { | |
13 int i = readint(); | |
14 struct large lala = bark(); | |
15 __transaction_atomic { | |
16 lala.x[55] = 666; | |
17 if (test()) | |
18 __transaction_cancel; | |
19 } | |
20 return lala.x[i]; | |
21 } | |
22 | |
23 /* { dg-final { scan-tree-dump-times "tm_save.\[0-9_\]+ = lala.x\\\[55\\\]" 1 "tmedge" } } */ | |
24 /* { dg-final { scan-tree-dump-times "lala.x\\\[55\\\] = tm_save" 1 "tmedge" } } */ |