1 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
3 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
8 bool foobool(int argc
) {
12 struct S1
; // expected-note {{declared here}}
14 template <class T
, class S
> // expected-note {{declared here}}
15 int tmain(T argc
, S
**argv
) {
17 #pragma omp parallel masked taskloop grainsize // expected-error {{expected '(' after 'grainsize'}}
18 for (int i
= 0; i
< 10; ++i
)
20 #pragma omp parallel masked taskloop grainsize ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
21 for (int i
= 0; i
< 10; ++i
)
23 #pragma omp parallel masked taskloop grainsize () // expected-error {{expected expression}}
24 for (int i
= 0; i
< 10; ++i
)
26 #pragma omp parallel masked taskloop grainsize (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
27 for (int i
= 0; i
< 10; ++i
)
29 #pragma omp parallel masked taskloop grainsize (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel masked taskloop' are ignored}}
30 for (int i
= 0; i
< 10; ++i
)
32 #pragma omp parallel masked taskloop grainsize (argc > 0 ? argv[1][0] : argv[2][argc] + z)
33 for (int i
= 0; i
< 10; ++i
)
35 #pragma omp parallel masked taskloop grainsize (foobool(argc)), grainsize (true) // expected-error {{directive '#pragma omp parallel masked taskloop' cannot contain more than one 'grainsize' clause}}
36 for (int i
= 0; i
< 10; ++i
)
38 #pragma omp parallel masked taskloop grainsize (S) // expected-error {{'S' does not refer to a value}}
39 for (int i
= 0; i
< 10; ++i
)
41 #pragma omp parallel masked taskloop grainsize (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
42 for (int i
= 0; i
< 10; ++i
)
44 #pragma omp parallel masked taskloop grainsize(0) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
45 for (int i
= 0; i
< 10; ++i
)
47 #pragma omp parallel masked taskloop grainsize(-1) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
48 for (int i
= 0; i
< 10; ++i
)
50 #pragma omp parallel masked 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}}
51 for (int i
= 0; i
< 10; ++i
)
57 int main(int argc
, char **argv
) {
59 #pragma omp parallel masked taskloop grainsize // expected-error {{expected '(' after 'grainsize'}}
60 for (int i
= 0; i
< 10; ++i
)
62 #pragma omp parallel masked taskloop grainsize ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
63 for (int i
= 0; i
< 10; ++i
)
65 #pragma omp parallel masked taskloop grainsize () // expected-error {{expected expression}}
66 for (int i
= 0; i
< 10; ++i
)
68 #pragma omp parallel masked taskloop grainsize (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
69 for (int i
= 0; i
< 10; ++i
)
71 #pragma omp parallel masked taskloop grainsize (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel masked taskloop' are ignored}}
72 for (int i
= 0; i
< 10; ++i
)
74 #pragma omp parallel masked taskloop grainsize (argc > 0 ? argv[1][0] : argv[2][argc] + z)
75 for (int i
= 0; i
< 10; ++i
)
77 #pragma omp parallel masked taskloop grainsize (foobool(argc)), grainsize (true) // expected-error {{directive '#pragma omp parallel masked taskloop' cannot contain more than one 'grainsize' clause}}
78 for (int i
= 0; i
< 10; ++i
)
80 #pragma omp parallel masked taskloop grainsize (S1) // expected-error {{'S1' does not refer to a value}}
81 for (int i
= 0; i
< 10; ++i
)
83 #pragma omp parallel masked taskloop grainsize (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
84 for (int i
= 0; i
< 10; ++i
)
86 #pragma omp parallel masked taskloop grainsize (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
87 for (int i
= 0; i
< 10; ++i
)
89 #pragma omp parallel masked taskloop grainsize(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
90 for (int i
= 0; i
< 10; ++i
)
92 #pragma omp parallel masked taskloop grainsize(0) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
93 for (int i
= 0; i
< 10; ++i
)
95 #pragma omp parallel masked taskloop grainsize(-1) // expected-error {{argument to 'grainsize' clause must be a strictly positive integer value}}
96 for (int i
= 0; i
< 10; ++i
)
98 #pragma omp parallel masked 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}}
99 for (int i
= 0; i
< 10; ++i
)
102 return tmain(argc
, argv
);