Debian Codegraph @

gcc/testsuite/c-c++-common/gomp/scan-7.c

raw
1 int a;
2
3 void
4 foo (int *c, int *d)
5 {
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)
9 {
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;
13 }
14 }
15
16 void
17 bar (int **c, int **d)
18 {
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)
23 {
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];
27 }
28 }
29
30 void
31 baz (int *c, int *d)
32 {
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)
36 {
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];
40 }
41 }
42
43 void
44 qux (int **c, int **d)
45 {
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)
50 {
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;
54 }
55 }