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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [libgomp/] [testsuite/] [libgomp.c/] [reduction-1.c] - Diff between revs 38 and 154

Only display areas with differences | Details | Blame | View Log

Rev 38 Rev 154
#include <omp.h>
#include <omp.h>
#include <stdlib.h>
#include <stdlib.h>
 
 
int
int
main (void)
main (void)
{
{
  int i = 0, j = 0, k = ~0;
  int i = 0, j = 0, k = ~0;
  double d = 1.0;
  double d = 1.0;
#pragma omp parallel num_threads(4) reduction(+:i) reduction(*:d) reduction(&:k)
#pragma omp parallel num_threads(4) reduction(+:i) reduction(*:d) reduction(&:k)
  {
  {
    if (i != 0 || d != 1.0 || k != ~0)
    if (i != 0 || d != 1.0 || k != ~0)
#pragma omp atomic
#pragma omp atomic
      j |= 1;
      j |= 1;
 
 
    if (omp_get_num_threads () != 4)
    if (omp_get_num_threads () != 4)
#pragma omp atomic
#pragma omp atomic
      j |= 2;
      j |= 2;
 
 
    i = omp_get_thread_num ();
    i = omp_get_thread_num ();
    d = i + 1;
    d = i + 1;
    k = ~(1 << (2 * i));
    k = ~(1 << (2 * i));
  }
  }
 
 
  if (j & 1)
  if (j & 1)
    abort ();
    abort ();
  if ((j & 2) == 0)
  if ((j & 2) == 0)
    {
    {
      if (i != (0 + 1 + 2 + 3))
      if (i != (0 + 1 + 2 + 3))
        abort ();
        abort ();
      if (d != (1.0 * 2.0 * 3.0 * 4.0))
      if (d != (1.0 * 2.0 * 3.0 * 4.0))
        abort ();
        abort ();
      if (k != (~0 ^ 0x55))
      if (k != (~0 ^ 0x55))
        abort ();
        abort ();
    }
    }
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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