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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgomp/] [testsuite/] [libgomp.c++/] [reduction-4.C] - Blame information for rev 751

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
 
5
template 
6
void
7
foo ()
8
{
9
  I j = -10000;
10
  F f = 1024.0;
11
  int i;
12
  #pragma omp parallel for reduction (min:f) reduction (max:j)
13
    for (i = 0; i < 4; i++)
14
      switch (i)
15
        {
16
        case 0:
17
          if (j < -16) j = -16; break;
18
        case 1:
19
          if (f > -2.0) f = -2.0; break;
20
        case 2:
21
          if (j < 8) j = 8; if (f > 9.0) f = 9.0; break;
22
        case 3:
23
          break;
24
        }
25
  if (j != 8 || f != -2.0)
26
    abort ();
27
}
28
 
29
int
30
main ()
31
{
32
  int j = -10000;
33
  float f = 1024.0;
34
  int i;
35
  #pragma omp parallel for reduction (min:f) reduction (max:j)
36
    for (i = 0; i < 4; i++)
37
      switch (i)
38
        {
39
        case 0:
40
          if (j < -16) j = -16; break;
41
        case 1:
42
          if (f > -2.0) f = -2.0; break;
43
        case 2:
44
          if (j < 8) j = 8; if (f > 9.0) f = 9.0; break;
45
        case 3:
46
          break;
47
        }
48
  if (j != 8 || f != -2.0)
49
    abort ();
50
  foo  ();
51
  foo  ();
52
  foo  ();
53
  return 0;
54
}

powered by: WebSVN 2.1.0

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