gcc/libitm/testsuite/libitm.c/simple-1.c
Aldy Hernandez 0a35513e4e Merge from transactional-memory branch.
From-SVN: r181154
2011-11-08 11:13:41 +00:00

25 lines
415 B
C

/* 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;
}