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 taskloop grainsize // expected-error {{expected '(' after 'grainsize'}}
20 for (int i
= 0; i
< 10; ++i
)
22 #pragma omp taskloop grainsize ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
23 for (int i
= 0; i
< 10; ++i
)
25 #pragma omp taskloop grainsize () // expected-error {{expected expression}}
26 for (int i
= 0; i
< 10; ++i
)
28 #pragma omp taskloop grainsize (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
29 for (int i
= 0; i
< 10; ++i
)
31 #pragma omp taskloop grainsize (argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop' are ignored}}
32 for (int i
= 0; i
< 10; ++i
)
34 #pragma omp taskloop grainsize (argc > 0 ? argv[1][0] : argv[2][argc] + z)
35 for (int i
= 0; i
< 10; ++i
)
37 #pragma omp taskloop grainsize (foobool(argc)), grainsize (true) // expected-error {{directive '#pragma omp taskloop' cannot contain more than one 'grainsize' clause}}
38 for (int i
= 0; i
< 10; ++i
)
40 #pragma omp taskloop grainsize (S) // expected-error {{'S' does not refer to a value}}
41 for (int i
= 0; i
< 10; ++i
)
43 #pragma omp taskloop grainsize (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
44 for (int i
= 0; i
< 10; ++i
)
46 #pragma omp taskloop 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 taskloop 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 taskloop 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
) {
61 #pragma omp taskloop grainsize // expected-error {{expected '(' after 'grainsize'}}
62 for (int i
= 0; i
< 10; ++i
)
64 #pragma omp taskloop grainsize ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
65 for (int i
= 0; i
< 10; ++i
)
67 #pragma omp taskloop grainsize () // expected-error {{expected expression}}
68 for (int i
= 0; i
< 10; ++i
)
70 #pragma omp taskloop grainsize (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
71 for (int i
= 0; i
< 10; ++i
)
73 #pragma omp taskloop grainsize (argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop' are ignored}}
74 for (int i
= 0; i
< 10; ++i
)
76 #pragma omp taskloop grainsize (argc > 0 ? argv[1][0] : argv[2][argc] + z)
77 for (int i
= 0; i
< 10; ++i
)
79 #pragma omp taskloop grainsize (foobool(argc)), grainsize (true) // expected-error {{directive '#pragma omp taskloop' cannot contain more than one 'grainsize' clause}}
80 for (int i
= 0; i
< 10; ++i
)
82 #pragma omp taskloop grainsize (S1) // expected-error {{'S1' does not refer to a value}}
83 for (int i
= 0; i
< 10; ++i
)
85 #pragma omp taskloop grainsize (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
86 for (int i
= 0; i
< 10; ++i
)
88 #pragma omp taskloop grainsize (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
89 for (int i
= 0; i
< 10; ++i
)
91 #pragma omp taskloop grainsize(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
92 for (int i
= 0; i
< 10; ++i
)
94 #pragma omp taskloop grainsize(0) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
95 for (int i
= 0; i
< 10; ++i
)
97 #pragma omp taskloop grainsize(-1) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
98 for (int i
= 0; i
< 10; ++i
)
100 #pragma omp taskloop 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}}
101 for (int i
= 0; i
< 10; ++i
)
104 return tmain(argc
, argv
);