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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [libgomp/] [testsuite/] [libgomp.c/] [pr32362-3.c] - Diff between revs 273 and 338

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

Rev 273 Rev 338
/* PR middle-end/32362 */
/* PR middle-end/32362 */
/* { dg-do run } */
/* { dg-do run } */
/* { dg-options "-O2" } */
/* { dg-options "-O2" } */
 
 
#include <omp.h>
#include <omp.h>
#include <stdlib.h>
#include <stdlib.h>
 
 
int a = 2;
int a = 2;
 
 
int
int
main ()
main ()
{
{
  int n[4] = { -1, -1, -1, -1 };
  int n[4] = { -1, -1, -1, -1 };
  int b = 4;
  int b = 4;
  omp_set_num_threads (4);
  omp_set_num_threads (4);
  omp_set_dynamic (0);
  omp_set_dynamic (0);
  omp_set_nested (1);
  omp_set_nested (1);
#pragma omp parallel private(b)
#pragma omp parallel private(b)
  {
  {
    b = omp_get_thread_num ();
    b = omp_get_thread_num ();
#pragma omp parallel firstprivate(a)
#pragma omp parallel firstprivate(a)
    {
    {
      a = (omp_get_thread_num () + a) + 1;
      a = (omp_get_thread_num () + a) + 1;
      if (b == omp_get_thread_num ())
      if (b == omp_get_thread_num ())
        n[omp_get_thread_num ()] = a + (b << 4);
        n[omp_get_thread_num ()] = a + (b << 4);
    }
    }
  }
  }
  if (n[0] != 3)
  if (n[0] != 3)
    abort ();
    abort ();
  if (n[3] != -1
  if (n[3] != -1
      && (n[1] != 0x14 || n[2] != 0x25 || n[3] != 0x36))
      && (n[1] != 0x14 || n[2] != 0x25 || n[3] != 0x36))
    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.