Mercurial > hg > CbC > CbC_gcc
comparison libgomp/testsuite/libgomp.c/appendix-a/a.29.1.c @ 0:a06113de4d67
first commit
author | kent <kent@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 17 Jul 2009 14:47:48 +0900 |
parents | |
children | 04ced10e8804 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:a06113de4d67 |
---|---|
1 /* { 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 } |