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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [libgomp/] [testsuite/] [libgomp.c/] [collapse-3.c] - Blame information for rev 859

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

Line No. Rev Author Line
1 273 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O2 -std=gnu99" } */
3
 
4
#include <string.h>
5
#include <stdlib.h>
6
 
7
int
8
main (void)
9
{
10
  int i2, l = 0;
11
  int a[3][3][3];
12
 
13
  memset (a, '\0', sizeof (a));
14
  #pragma omp parallel for collapse(4 - 1) schedule(static, 4)
15
    for (int i = 0; i < 2; i++)
16
      for (int j = 0; j < 2; j++)
17
        for (int k = 0; k < 2; k++)
18
          a[i][j][k] = i + j * 4 + k * 16;
19
  #pragma omp parallel
20
    {
21
      #pragma omp for collapse(2) reduction(|:l)
22
        for (i2 = 0; i2 < 2; i2++)
23
          for (int j = 0; j < 2; j++)
24
            for (int k = 0; k < 2; k++)
25
              if (a[i2][j][k] != i2 + j * 4 + k * 16)
26
                l = 1;
27
    }
28
  if (l)
29
    abort ();
30
  return 0;
31
}

powered by: WebSVN 2.1.0

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