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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgomp/] [testsuite/] [libgomp.c++/] [atomic-6.C] - Blame information for rev 849

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

Line No. Rev Author Line
1 735 jeremybenn
// { dg-do run }
2
 
3
extern "C" void abort (void);
4
long long l, m;
5
int i, j;
6
 
7
void
8
foo (void)
9
{
10
  #pragma omp atomic read
11
    i = l;
12
  #pragma omp atomic read
13
    m = j;
14
  if (i != 77 || m != 88)
15
    abort ();
16
  #pragma omp atomic write
17
    l = 1 + i + 6 * 1;
18
  #pragma omp atomic write
19
    j = 170 - 170 + m + 1 * 7;
20
  #pragma omp atomic capture
21
    i = l += 4;
22
  #pragma omp atomic capture
23
    m = j += 4;
24
  if (i != 88 || m != 99)
25
    abort ();
26
  #pragma omp atomic capture
27
    {
28
      i = l;
29
      l += 4;
30
    }
31
  #pragma omp atomic capture
32
    {
33
      m = j;
34
      j += 4;
35
    }
36
  if (i != 88 || m != 99)
37
    abort ();
38
  #pragma omp atomic capture
39
    {
40
      l += 4;
41
      i = l;
42
    }
43
  #pragma omp atomic capture
44
    {
45
      j += 4;
46
      m = j;
47
    }
48
  if (i != 96 || m != 107)
49
    abort ();
50
}
51
 
52
int
53
main ()
54
{
55
  l = 77;
56
  j = 88;
57
  foo ();
58
}

powered by: WebSVN 2.1.0

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