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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libitm/] [testsuite/] [libitm.c/] [simple-1.c] - Rev 830

Go to most recent revision | Compare with Previous | Blame | View Log

/* Verify that two sequential runs of a transaction will complete and
   produce correct results.  An early test of the library did in fact
   leave things in an inconsistent state following the commit of the
   first transaction.  */
 
#include <stdlib.h>
 
static int x;
 
static void start (void)
{
  __transaction_atomic { x++; }
}
 
int main()
{
  start ();
  start ();
 
  if (x != 2)
    abort ();
 
  return 0;
}
 

Go to most recent revision | 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.