OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [tm/] [memopt-15.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do compile { target { x86_64-*-linux* } } } */
2
/* { dg-options "-fgnu-tm -O" } */
3
 
4
/* Test the TM vector logging functions.  */
5
 
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));
9
 
10
vectype vecky;
11
 
12
vectype f()
13
{
14
  vectype *p;
15
 
16
  p = malloc (sizeof (*p) * 100);
17
 
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;
23
 
24
    if (something())
25
      __transaction_cancel;
26
  }
27
  return p[5];
28
}
29
 
30
/* { dg-final { scan-assembler "_ITM_LM128" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.