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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgomp/] [testsuite/] [libgomp.c/] [reduction-5.c] - Blame information for rev 865

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

Line No. Rev Author Line
1 735 jeremybenn
/* PR middle-end/36506 */
2
 
3
extern void abort (void);
4
 
5
int
6
main (void)
7
{
8
  int sum = 0, prod = 1;
9
#pragma omp parallel
10
  #pragma omp sections reduction (+:sum)
11
    {
12
    #pragma omp section
13
      sum += 2;
14
    #pragma omp section
15
      sum += 2;
16
    #pragma omp section
17
      sum += 2;
18
    }
19
  if (sum != 6)
20
    abort ();
21
  sum = 0;
22
#pragma omp parallel sections reduction (+:sum)
23
  {
24
  #pragma omp section
25
    sum += 2;
26
  #pragma omp section
27
    sum += 2;
28
  #pragma omp section
29
    sum += 2;
30
  }
31
  if (sum != 6)
32
    abort ();
33
  sum = 0;
34
#pragma omp parallel
35
  #pragma omp sections reduction (+:sum) reduction (*:prod)
36
    {
37
    #pragma omp section
38
      {
39
        sum += 2;
40
        prod *= 2;
41
      }
42
    #pragma omp section
43
      {
44
        sum += 2;
45
        prod *= 2;
46
      }
47
    #pragma omp section
48
      {
49
        sum += 2;
50
        prod *= 2;
51
      }
52
    }
53
  if (sum != 6 || prod != 8)
54
    abort ();
55
  sum = 0;
56
  prod = 1;
57
#pragma omp parallel sections reduction (+:sum) reduction (*:prod)
58
  {
59
  #pragma omp section
60
    {
61
      sum += 2;
62
      prod *= 2;
63
    }
64
  #pragma omp section
65
    {
66
      sum += 2;
67
      prod *= 2;
68
    }
69
  #pragma omp section
70
    {
71
      sum += 2;
72
      prod *= 2;
73
    }
74
  }
75
  if (sum != 6 || prod != 8)
76
    abort ();
77
  return 0;
78
}

powered by: WebSVN 2.1.0

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