Lower zeroing array assignment to memset for allocatable arrays.
[official-gcc.git] / gcc / testsuite / c-c++-common / gomp / scan-7.c
blob412c98d5ee0601f7f2921fbe8ce829dedf5a6aff
1 int a;
3 void
4 foo (int *c, int *d)
6 #pragma omp for reduction (inscan, +: a) /* { dg-error "'a' specified in 'inscan' 'reduction' clause but not in 'scan' directive clause" } */
7 #pragma omp tile sizes (2)
8 for (int i = 0; i < 64; ++i)
10 a = a + c[i];
11 #pragma omp scan inclusive (a) /* { dg-error "'#pragma omp scan' may only be used in a loop construct with 'inscan' 'reduction' clause" } */
12 d[i] = a;
16 void
17 bar (int **c, int **d)
19 #pragma omp for collapse (2) reduction (inscan, +: a) /* { dg-error "'a' specified in 'inscan' 'reduction' clause but not in 'scan' directive clause" } */
20 for (int i = 0; i < 64; ++i)
21 #pragma omp tile sizes (3)
22 for (int j = 0; j < 64; ++j)
24 d[i][j] = a;
25 #pragma omp scan exclusive (a) /* { dg-error "'#pragma omp scan' may only be used in a loop construct with 'inscan' 'reduction' clause" } */
26 a = a + c[i][j];
30 void
31 baz (int *c, int *d)
33 #pragma omp for reduction (inscan, +: a) /* { dg-error "'a' specified in 'inscan' 'reduction' clause but not in 'scan' directive clause" } */
34 #pragma omp unroll partial (2)
35 for (int i = 0; i < 64; ++i)
37 d[i] = a;
38 #pragma omp scan exclusive (a) /* { dg-error "'#pragma omp scan' may only be used in a loop construct with 'inscan' 'reduction' clause" } */
39 a = a + c[i];
43 void
44 qux (int **c, int **d)
46 #pragma omp for collapse (2) reduction (inscan, +: a) /* { dg-error "'a' specified in 'inscan' 'reduction' clause but not in 'scan' directive clause" } */
47 for (int i = 0; i < 64; ++i)
48 #pragma omp unroll partial (3)
49 for (int j = 0; j < 64; ++j)
51 a = a + c[i][j];
52 #pragma omp scan inclusive (a) /* { dg-error "'#pragma omp scan' may only be used in a loop construct with 'inscan' 'reduction' clause" } */
53 d[i][j] = a;