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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [libgomp/] [testsuite/] [libgomp.c/] [reduction-4.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 julius
#include <omp.h>
2
#include <stdlib.h>
3
 
4
int
5
main (void)
6
{
7
  int i = 0, j = 0, k = 0, l = 0;
8
#pragma omp parallel num_threads(4) reduction(-:i) reduction(|:k) \
9
                     reduction(^:l)
10
  {
11
    if (i != 0 || k != 0 || l != 0)
12
#pragma omp atomic
13
      j |= 1;
14
 
15
    if (omp_get_num_threads () != 4)
16
#pragma omp atomic
17
      j |= 2;
18
 
19
    i = omp_get_thread_num ();
20
    k = 1 << (2 * i);
21
    l = 0xea << (3 * i);
22
  }
23
 
24
  if (j & 1)
25
    abort ();
26
  if ((j & 2) == 0)
27
    {
28
      if (i != (0 + 1 + 2 + 3))
29
        abort ();
30
      if (k != 0x55)
31
        abort ();
32
      if (l != 0x1e93a)
33
        abort ();
34
    }
35
  return 0;
36
}

powered by: WebSVN 2.1.0

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