* gcc.target/i386/mpx/hard-reg-1-nov.c (mpx_test): Use "esp"
[official-gcc.git] / gcc / testsuite / gcc.dg / tm / memopt-15.c
blob411feb809bb0eb9ee0450aae9b575324f6338b26
1 /* { dg-do compile { target { i?86-*-linux* x86_64-*-linux* } } } */
2 /* { dg-options "-fgnu-tm -O -msse2" } */
4 /* Test the TM vector logging functions. */
6 typedef int __attribute__((vector_size (16))) vectype;
7 extern int something(void) __attribute__((transaction_safe));
8 extern void *malloc (__SIZE_TYPE__) __attribute__((malloc,transaction_safe));
10 vectype vecky;
12 vectype f()
14 vectype *p;
16 p = malloc (sizeof (*p) * 100);
18 __transaction_atomic {
19 /* p[5] is thread private, but not transaction local since the
20 malloc is outside of the transaction. We can use the logging
21 functions for this. */
22 p[5] = vecky;
24 if (something())
25 __transaction_cancel;
27 return p[5];
30 /* { dg-final { scan-assembler "_ITM_LM128" } } */