Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / tm / memopt-5.c
blob5ad24e048ae5ae29364c57c09e2a6b1d723873ee
1 /* { dg-do compile } */
2 /* { dg-options "-fgnu-tm -O -fdump-tree-tmedge --param tm-max-aggregate-size=1" } */
4 /* Test thread-local memory optimizations: logging function. */
6 struct large { int x[100]; };
7 struct large bark();
8 extern int test (void) __attribute__((transaction_safe));
9 extern int readint (void);
11 int f()
13 int i = readint();
14 struct large lala = bark();
15 __transaction_atomic {
16 lala.x[55] = 666;
17 if (test())
18 __transaction_cancel;
20 return lala.x[i];
23 /* { dg-final { scan-tree-dump-times "ITM_LU\[0-9\] \\\(&lala.x\\\[55\\\]" 1 "tmedge" } } */