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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libitm/] [testsuite/] [libitm.c/] [dropref-2.c] - Blame information for rev 738

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

Line No. Rev Author Line
1 737 jeremybenn
/* { dg-xfail-run-if "unsupported" { *-*-* } } */
2
#include <stdlib.h>
3
#include <libitm.h>
4
 
5
/* Test that _ITM_dropReferences() forces a commit of given chunk.  */
6
 
7
unsigned char pp[100];
8
 
9
int main()
10
{
11
  int i;
12
 
13
  for(i=0; i < 100; ++i)
14
    pp[i]=0x22;
15
 
16
  __transaction_atomic {
17
    for(i=0; i < 100; ++i)
18
      pp[i]=0x33;
19
 
20
    /* This should write-through pp[0..49]...  */
21
    _ITM_dropReferences (pp, 50);
22
 
23
    /* ...while this should revert everything but pp[0..49].  */
24
    __transaction_cancel;
25
  }
26
 
27
  for(i=0; i < 50; ++i)
28
    if (pp[i] != 0x33)
29
      abort();
30
 
31
  for(i=50; i < 100; ++i)
32
    if (pp[i] != 0x22)
33
      abort();
34
 
35
  return 0;
36
}

powered by: WebSVN 2.1.0

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