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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [libgomp/] [testsuite/] [libgomp.c/] [pr32362-1.c] - Blame information for rev 853

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

Line No. Rev Author Line
1 38 julius
/* PR middle-end/32362 */
2
/* { dg-do run } */
3
/* { dg-options "-O2" } */
4
 
5
#include <omp.h>
6
#include <stdlib.h>
7
 
8
int
9
main ()
10
{
11
  int n[4] = { -1, -1, -1, -1 };
12
  static int a = 2, b = 4;
13
  omp_set_num_threads (4);
14
  omp_set_dynamic (0);
15
  omp_set_nested (1);
16
#pragma omp parallel private(b)
17
  {
18
    b = omp_get_thread_num ();
19
#pragma omp parallel firstprivate(a)
20
    {
21
      a = (omp_get_thread_num () + a) + 1;
22
      if (b == omp_get_thread_num ())
23
        n[omp_get_thread_num ()] = a + (b << 4);
24
    }
25
  }
26
  if (n[0] != 3)
27
    abort ();
28
  if (n[3] != -1
29
      && (n[1] != 0x14 || n[2] != 0x25 || n[3] != 0x36))
30
    abort ();
31
  return 0;
32
}

powered by: WebSVN 2.1.0

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