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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [libgomp/] [testsuite/] [libgomp.c/] [omp-single-2.c] - Blame information for rev 859

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

Line No. Rev Author Line
1 273 jeremybenn
#include <omp.h>
2
 
3
extern void abort (void);
4
 
5
struct X
6
{
7
  int a;
8
  char b;
9
  int c;
10
};
11
 
12
main()
13
{
14
  int i = 0;
15
  struct X x;
16
  int bad = 0;
17
 
18
  #pragma omp parallel private (i, x) shared (bad)
19
    {
20
      i = 5;
21
 
22
      #pragma omp single copyprivate (i, x)
23
        {
24
          i++;
25
          x.a = 23;
26
          x.b = 42;
27
          x.c = 26;
28
        }
29
 
30
      if (i != 6 || x.a != 23 || x.b != 42 || x.c != 26)
31
        bad = 1;
32
    }
33
 
34
  if (bad)
35
    abort ();
36
 
37
  return 0;
38
}

powered by: WebSVN 2.1.0

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