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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [tm/] [20100615.c] - Rev 689

Compare with Previous | Blame | View Log

/* { dg-do compile } */
/* { dg-options "-fgnu-tm -O" } */
 
/* Since the non TM version of new_node() gets optimized away, it
   shouldn't appear in the clone table either.  */
/* { dg-final { scan-assembler-not "tm_clone_table" { target { ! *-*-darwin*  } } } } */
/* { dg-final { scan-assembler-not "__DATA,__tm_clone_table" { target *-*-darwin*  } } } */
 
#define NULL 0
extern void *malloc (__SIZE_TYPE__);
 
__attribute__((transaction_pure))
void exit(int status);
 
typedef struct node {
} node_t;
 
__attribute__((transaction_safe))
static node_t *new_node(node_t *next)
{
  node_t *node;
  node = (node_t *)malloc(sizeof(node_t));
  if (node == NULL) {
    exit(1);
  }
  return NULL;
}
 
static node_t *set_new()
{
  node_t *min, *max;
  __transaction_atomic {
    max = new_node(NULL);
    min = new_node(max);
  }
  return min;
}
 
int main(int argc, char **argv)
{
  set_new();
  return 0;
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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