1 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
6 bool foobool(int argc) {
10 struct S1; // expected-note {{declared here}}
12 template <class T, class S> // expected-note {{declared here}}
13 int tmain(T argc, S **argv) {
14 #pragma omp taskloop simd priority // expected-error {{expected '(' after 'priority'}}
15 for (int i = 0; i < 10; ++i)
17 #pragma omp taskloop simd priority ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
18 for (int i = 0; i < 10; ++i)
20 #pragma omp taskloop simd priority () // expected-error {{expected expression}}
21 for (int i = 0; i < 10; ++i)
23 #pragma omp taskloop simd priority (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
24 for (int i = 0; i < 10; ++i)
26 #pragma omp taskloop simd priority (argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop simd' are ignored}}
27 for (int i = 0; i < 10; ++i)
29 #pragma omp taskloop simd priority (argc > 0 ? argv[1][0] : argv[2][argc])
30 for (int i = 0; i < 10; ++i)
32 #pragma omp taskloop simd priority (foobool(argc)), priority (true) // expected-error {{directive '#pragma omp taskloop simd' cannot contain more than one 'priority' clause}}
33 for (int i = 0; i < 10; ++i)
35 #pragma omp taskloop simd priority (S) // expected-error {{'S' does not refer to a value}}
36 for (int i = 0; i < 10; ++i)
38 #pragma omp taskloop simd priority (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
39 for (int i = 0; i < 10; ++i)
41 #pragma omp taskloop simd priority(0)
42 for (int i = 0; i < 10; ++i)
44 #pragma omp taskloop simd priority(-1) // expected-error {{argument to 'priority' clause must be a non-negative integer value}}
45 for (int i = 0; i < 10; ++i)
51 int main(int argc, char **argv) {
52 #pragma omp taskloop simd priority // expected-error {{expected '(' after 'priority'}}
53 for (int i = 0; i < 10; ++i)
55 #pragma omp taskloop simd priority ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
56 for (int i = 0; i < 10; ++i)
58 #pragma omp taskloop simd priority () // expected-error {{expected expression}}
59 for (int i = 0; i < 10; ++i)
61 #pragma omp taskloop simd priority (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
62 for (int i = 0; i < 10; ++i)
64 #pragma omp taskloop simd priority (argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop simd' are ignored}}
65 for (int i = 0; i < 10; ++i)
67 #pragma omp taskloop simd priority (argc > 0 ? argv[1][0] : argv[2][argc])
68 for (int i = 0; i < 10; ++i)
70 #pragma omp taskloop simd priority (foobool(argc)), priority (true) // expected-error {{directive '#pragma omp taskloop simd' cannot contain more than one 'priority' clause}}
71 for (int i = 0; i < 10; ++i)
73 #pragma omp taskloop simd priority (S1) // expected-error {{'S1' does not refer to a value}}
74 for (int i = 0; i < 10; ++i)
76 #pragma omp taskloop simd priority (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
77 for (int i = 0; i < 10; ++i)
79 #pragma omp taskloop simd priority (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
80 for (int i = 0; i < 10; ++i)
82 #pragma omp taskloop simd priority(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
83 for (int i = 0; i < 10; ++i)
85 #pragma omp taskloop simd priority(0)
86 for (int i = 0; i < 10; ++i)
88 #pragma omp taskloop simd priority(-1) // expected-error {{argument to 'priority' clause must be a non-negative integer value}}
89 for (int i = 0; i < 10; ++i)
92 return tmain(argc, argv);