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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [libgomp/] [testsuite/] [libgomp.c/] [pr42942.c] - Blame information for rev 816

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

Line No. Rev Author Line
1 273 jeremybenn
/* PR libgomp/42942 */
2
/* { dg-do run } */
3
 
4
#include <omp.h>
5
#include <stdlib.h>
6
 
7
int
8
main (void)
9
{
10
  int e = 0;
11
  omp_set_dynamic (0);
12
  omp_set_nested (1);
13
  omp_set_max_active_levels (1);
14
  if (omp_get_max_active_levels () != 1)
15
    abort ();
16
#pragma omp parallel num_threads(2) reduction(|:e)
17
  if (!omp_in_parallel ()
18
      || omp_get_num_threads () != 2)
19
    e = 1;
20
  else
21
#pragma omp parallel num_threads(2) reduction(|:e)
22
    if (!omp_in_parallel ()
23
        || omp_get_num_threads () != 1)
24
      e = 1;
25
  if (e)
26
    abort ();
27
  omp_set_max_active_levels (0);
28
  if (omp_get_max_active_levels () != 0)
29
    abort ();
30
#pragma omp parallel num_threads(2) reduction(|:e)
31
  if (omp_in_parallel ()
32
      || omp_get_num_threads () != 1)
33
    e = 1;
34
  else
35
#pragma omp parallel num_threads(2) reduction(|:e)
36
    if (omp_in_parallel ()
37
        || omp_get_num_threads () != 1)
38
      e = 1;
39
  if (e)
40
    abort ();
41
  omp_set_max_active_levels (2);
42
  if (omp_get_max_active_levels () != 2)
43
    abort ();
44
#pragma omp parallel num_threads(2) reduction(|:e)
45
  if (!omp_in_parallel ()
46
      || omp_get_num_threads () != 2)
47
    e = 1;
48
  else
49
#pragma omp parallel num_threads(2) reduction(|:e)
50
    if (!omp_in_parallel ()
51
        || omp_get_num_threads () != 2)
52
      e = 1;
53
    else
54
#pragma omp parallel num_threads(2) reduction(|:e)
55
      if (!omp_in_parallel ()
56
          || omp_get_num_threads () != 1)
57
        e = 1;
58
  if (e)
59
    abort ();
60
  return 0;
61
}

powered by: WebSVN 2.1.0

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