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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [c-c++-common/] [tm/] [20100127.c] - Blame information for rev 686

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 686 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-fgnu-tm -O -fdump-tree-tmmark" } */
3
 
4
/* Test that `nontrxn' doesn't end up inside the transaction.  */
5
 
6
typedef struct node {
7
  int * val;
8
  struct node *next;
9
} node_t;
10
 
11
node_t *next;
12
int nontrxn1, nontrxn;
13
 
14
static int set_remove(int * val)
15
{
16
  int result;
17
  int * v;
18
  __transaction_relaxed {
19
    v = next->val;
20
    result = (v == val);
21
    if (result)
22
      result = 2;
23
  }
24
  return result;
25
}
26
 
27
void test(void *data)
28
{
29
  extern void bark(void);
30
  if (set_remove(0))
31
    bark();
32
  nontrxn = 99;                 /* Should be outside transaction.  */
33
}
34
 
35
/* { dg-final { scan-tree-dump-times "_ITM_W.*nontrxn" 0 "tmmark" } } */
36
/* { dg-final { cleanup-tree-dump "tmmark" } } */

powered by: WebSVN 2.1.0

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