1 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
2 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=51 -ferror-limit 100 %s -Wuninitialized
4 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
5 // RUN: %clang_cc1 -verify -fopenmp-version=51 -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
10 bool foobool(int argc
) {
14 struct S1
; // expected-note {{declared here}}
16 template <class T
, class S
> // expected-note {{declared here}}
17 int tmain(T argc
, S
**argv
) {
19 #pragma omp masked taskloop simd grainsize // expected-error {{expected '(' after 'grainsize'}}
20 for (int i
= 0; i
< 10; ++i
)
22 #pragma omp masked taskloop simd grainsize ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
23 for (int i
= 0; i
< 10; ++i
)
25 #pragma omp masked taskloop simd grainsize () // expected-error {{expected expression}}
26 for (int i
= 0; i
< 10; ++i
)
28 #pragma omp masked taskloop simd grainsize (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
29 for (int i
= 0; i
< 10; ++i
)
31 #pragma omp masked taskloop simd grainsize (z + argc)) // expected-warning {{extra tokens at the end of '#pragma omp masked taskloop simd' are ignored}}
32 for (int i
= 0; i
< 10; ++i
)
34 #pragma omp masked taskloop simd grainsize (argc > 0 ? argv[1][0] : argv[2][argc])
35 for (int i
= 0; i
< 10; ++i
)
37 #pragma omp masked taskloop simd grainsize (foobool(argc)), grainsize (true) // expected-error {{directive '#pragma omp masked taskloop simd' cannot contain more than one 'grainsize' clause}}
38 for (int i
= 0; i
< 10; ++i
)
40 #pragma omp masked taskloop simd grainsize (S) // expected-error {{'S' does not refer to a value}}
41 for (int i
= 0; i
< 10; ++i
)
43 #pragma omp masked taskloop simd grainsize (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
44 for (int i
= 0; i
< 10; ++i
)
46 #pragma omp masked taskloop simd grainsize(0) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
47 for (int i
= 0; i
< 10; ++i
)
49 #pragma omp masked taskloop simd grainsize(-1) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
50 for (int i
= 0; i
< 10; ++i
)
52 #pragma omp masked taskloop simd grainsize(argc) num_tasks(argc) // expected-error {{'num_tasks' and 'grainsize' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'grainsize' clause is specified here}}
53 for (int i
= 0; i
< 10; ++i
)
59 int main(int argc
, char **argv
) {
62 #pragma omp masked taskloop simd filter(tid) grainsize // expected-error {{expected '(' after 'grainsize'}}
63 for (int i
= 0; i
< 10; ++i
)
65 #pragma omp masked taskloop simd grainsize ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
66 for (int i
= 0; i
< 10; ++i
)
68 #pragma omp masked taskloop simd grainsize () // expected-error {{expected expression}}
69 for (int i
= 0; i
< 10; ++i
)
71 #pragma omp masked taskloop simd grainsize (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
72 for (int i
= 0; i
< 10; ++i
)
74 #pragma omp masked taskloop simd grainsize (argc+z)) // expected-warning {{extra tokens at the end of '#pragma omp masked taskloop simd' are ignored}}
75 for (int i
= 0; i
< 10; ++i
)
77 #pragma omp masked taskloop simd grainsize (argc > 0 ? argv[1][0] : argv[2][argc])
78 for (int i
= 0; i
< 10; ++i
)
80 #pragma omp masked taskloop simd grainsize (foobool(argc)), grainsize (true) // expected-error {{directive '#pragma omp masked taskloop simd' cannot contain more than one 'grainsize' clause}}
81 for (int i
= 0; i
< 10; ++i
)
83 #pragma omp masked taskloop simd grainsize (S1) // expected-error {{'S1' does not refer to a value}}
84 for (int i
= 0; i
< 10; ++i
)
86 #pragma omp masked taskloop simd grainsize (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
87 for (int i
= 0; i
< 10; ++i
)
89 #pragma omp masked taskloop simd grainsize (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
90 for (int i
= 0; i
< 10; ++i
)
92 #pragma omp masked taskloop simd grainsize(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
93 for (int i
= 0; i
< 10; ++i
)
95 #pragma omp masked taskloop simd grainsize(0) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
96 for (int i
= 0; i
< 10; ++i
)
98 #pragma omp masked taskloop simd grainsize(-1) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
99 for (int i
= 0; i
< 10; ++i
)
101 #pragma omp masked taskloop simd grainsize(argc) num_tasks(argc) // expected-error {{'num_tasks' and 'grainsize' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'grainsize' clause is specified here}}
102 for (int i
= 0; i
< 10; ++i
)
105 return tmain(argc
, argv
);