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] - Blame information for rev 765

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

Line No. Rev Author Line
1 737 jeremybenn
/* Verify that two sequential runs of a transaction will complete and
2
   produce correct results.  An early test of the library did in fact
3
   leave things in an inconsistent state following the commit of the
4
   first transaction.  */
5
 
6
#include <stdlib.h>
7
 
8
static int x;
9
 
10
static void start (void)
11
{
12
  __transaction_atomic { x++; }
13
}
14
 
15
int main()
16
{
17
  start ();
18
  start ();
19
 
20
  if (x != 2)
21
    abort ();
22
 
23
  return 0;
24
}

powered by: WebSVN 2.1.0

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