1 void f1 (int, int, int);
2 int iii (int, int, int);
5 s1 (int a1
, int a2
, int a3
)
8 #pragma omp simd collapse(3) reduction (inscan, +:r)
9 for (int i
= 0; i
< a1
; i
++)
10 for (int j
= 0; j
< a2
; j
++)
11 for (int k
= 0; k
< a3
; k
++)
13 #pragma omp scan exclusive (r) /* { dg-warning "'#pragma omp scan' with zero preceding executable statements" } */
17 #pragma omp simd collapse(3) reduction (inscan, +:r)
18 for (int i
= 0; i
< a1
; i
++)
19 for (int j
= 0; j
< a2
; j
++)
20 for (int k
= 0; k
< a3
; k
++)
23 #pragma omp scan exclusive (r) /* { dg-warning "'#pragma omp scan' with zero succeeding executable statements" } */
26 #pragma omp simd collapse(3) reduction (inscan, +:r)
27 for (int i
= 0; i
< a1
; i
++)
28 for (int j
= 0; j
< a2
; j
++)
29 for (int k
= 0; k
< a3
; k
++)
31 #pragma omp scan inclusive (r)
32 /* { dg-warning "'#pragma omp scan' with zero preceding executable statements" "" { target *-*-* } .-1 } */
33 /* { dg-warning "'#pragma omp scan' with zero succeeding executable statements" "" { target *-*-* } .-2 } */
39 s2 (int a1
, int a2
, int a3
)
42 #pragma omp simd collapse(3) reduction (inscan, +:r) /* { dg-error "'r' specified in 'inscan' 'reduction' clause but not in 'scan' directive clause" } */
43 for (int i
= 0; i
< a1
; i
++)
44 for (int j
= 0; j
< a2
; j
++)
45 for (int k
= 0; k
< a3
; k
++)
48 r
+= iii (i
, j
, k
); /* { dg-error "expected '#pragma omp scan'" "" { target c++ } } */
49 } /* { dg-error "expected '#pragma omp scan'" "" { target c } } */
52 #pragma omp simd collapse(3) reduction (inscan, +:r) /* { dg-error "'r' specified in 'inscan' 'reduction' clause but not in 'scan' directive clause" } */
53 for (int i
= 0; i
< a1
; i
++)
54 for (int j
= 0; j
< a2
; j
++)
55 for (int k
= 0; k
< a3
; k
++)
56 ; /* { dg-error "expected '\{' before ';' token" } */
58 #pragma omp simd collapse(3) reduction (inscan, +:r) /* { dg-error "'r' specified in 'inscan' 'reduction' clause but not in 'scan' directive clause" } */
59 for (int i
= 0; i
< a1
; i
++)
60 for (int j
= 0; j
< a2
; j
++)
61 for (int k
= 0; k
< a3
; k
++)
63 } /* { dg-error "expected expression before '\}' token" "" { target c } } */
64 /* { dg-error "expected primary-expression before '\}' token" "" { target c++ } .-1 } */
65 /* { dg-error "expected '#pragma omp scan'" "" { target *-*-* } .-2 } */
69 #pragma omp simd collapse(3) reduction (inscan, +:r)
70 for (int i
= 0; i
< a1
; i
++)
71 for (int j
= 0; j
< a2
; j
++)
72 for (int k
= 0; k
< a3
; k
++)
75 #pragma omp scan inclusive (r)
76 #pragma omp scan inclusive (r) /* { dg-error "'#pragma omp scan' may only be used in a loop construct with 'inscan' 'reduction' clause" } */
80 #pragma omp scan inclusive (r) /* { dg-error "'#pragma omp scan' may only be used in a loop construct with 'inscan' 'reduction' clause" } */
83 #pragma omp simd collapse(3) reduction (inscan, +:r) /* { dg-error "'r' specified in 'inscan' 'reduction' clause but not in 'scan' directive clause" } */
84 for (int i
= 0; i
< a1
; i
++)
85 for (int j
= 0; j
< a2
; j
++)
86 for (int k
= 0; k
< a3
; k
++)
90 #pragma omp scan inclusive (r) /* { dg-error "'#pragma omp scan' may only be used in a loop construct with 'inscan' 'reduction' clause" } */
92 r
+= iii (i
, j
, k
); /* { dg-error "expected '#pragma omp scan'" "" { target c++ } } */
93 } /* { dg-error "expected '#pragma omp scan'" "" { target c } } */