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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgomp/] [testsuite/] [libgomp.c/] [appendix-a/] [a.29.1.c] - Blame information for rev 830

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

Line No. Rev Author Line
1 735 jeremybenn
/* { dg-do run } */
2
 
3
#include <assert.h>
4
int A[2][2] = { 1, 2, 3, 4 };
5
void
6
f (int n, int B[n][n], int C[])
7
{
8
  int D[2][2] = { 1, 2, 3, 4 };
9
  int E[n][n];
10
  assert (n >= 2);
11
  E[1][1] = 4;
12
#pragma omp parallel firstprivate(B, C, D, E)
13
  {
14
    assert (sizeof (B) == sizeof (int (*)[n]));
15
    assert (sizeof (C) == sizeof (int *));
16
    assert (sizeof (D) == 4 * sizeof (int));
17
    assert (sizeof (E) == n * n * sizeof (int));
18
    /* Private B and C have values of original B and C. */
19
    assert (&B[1][1] == &A[1][1]);
20
    assert (&C[3] == &A[1][1]);
21
    assert (D[1][1] == 4);
22
    assert (E[1][1] == 4);
23
  }
24
}
25
int
26
main ()
27
{
28
  f (2, A, A[0]);
29
  return 0;
30
}

powered by: WebSVN 2.1.0

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