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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgomp/] [testsuite/] [libgomp.c/] [pr32362-3.c] - Blame information for rev 791

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

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

powered by: WebSVN 2.1.0

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