* gcc.target/i386/mpx/hard-reg-1-nov.c (mpx_test): Use "esp"
[official-gcc.git] / gcc / testsuite / gcc.dg / tm / memopt-8.c
blobf0e6e0831302d1fa661a50a41d5986d9524a4ae1
1 /* { dg-do compile } */
2 /* { dg-options "-fgnu-tm -O -fdump-tree-tmmark" } */
4 extern int something(void) __attribute__((transaction_safe));
5 extern int escape(int *) __attribute__((transaction_safe));
6 extern void *malloc (__SIZE_TYPE__) __attribute__((malloc,transaction_safe));
8 int f()
10 int *p;
12 __transaction_atomic {
13 p = malloc (sizeof (*p) * 100);
14 escape (p);
16 /* This should be instrumented because P escapes. */
17 p[5] = 123;
19 if (something())
20 __transaction_cancel;
22 return p[5];
25 /* { dg-final { scan-tree-dump-times "ITM_WU" 1 "tmmark" } } */