• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
2 
foo()3 void foo() {
4 }
5 
foobool(int argc)6 bool foobool(int argc) {
7   return argc;
8 }
9 
10 struct S1; // expected-note {{declared here}}
11 
12 template <class T, class S> // expected-note {{declared here}}
tmain(T argc,S ** argv)13 int tmain(T argc, S **argv) {
14   #pragma omp task priority // expected-error {{expected '(' after 'priority'}}
15   #pragma omp task priority ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
16   #pragma omp task priority () // expected-error {{expected expression}}
17   #pragma omp task priority (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
18   #pragma omp task priority (argc)) // expected-warning {{extra tokens at the end of '#pragma omp task' are ignored}}
19   #pragma omp task priority (argc > 0 ? argv[1][0] : argv[2][argc])
20   #pragma omp task priority (foobool(argc)), priority (true) // expected-error {{directive '#pragma omp task' cannot contain more than one 'priority' clause}}
21   #pragma omp task priority (S) // expected-error {{'S' does not refer to a value}}
22   #pragma omp task priority (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
23   #pragma omp task priority(0)
24   #pragma omp task priority(-1) // expected-error {{argument to 'priority' clause must be a non-negative integer value}}
25   foo();
26 
27   return 0;
28 }
29 
main(int argc,char ** argv)30 int main(int argc, char **argv) {
31   #pragma omp task priority // expected-error {{expected '(' after 'priority'}}
32   #pragma omp task priority ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
33   #pragma omp task priority () // expected-error {{expected expression}}
34   #pragma omp task priority (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
35   #pragma omp task priority (argc)) // expected-warning {{extra tokens at the end of '#pragma omp task' are ignored}}
36   #pragma omp task priority (argc > 0 ? argv[1][0] : argv[2][argc])
37   #pragma omp task priority (foobool(argc)), priority (true) // expected-error {{directive '#pragma omp task' cannot contain more than one 'priority' clause}}
38   #pragma omp task priority (S1) // expected-error {{'S1' does not refer to a value}}
39   #pragma omp task priority (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
40   #pragma omp task priority (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
41   #pragma omp task priority(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
42   #pragma omp task priority(0)
43   #pragma omp task priority(-1) // expected-error {{argument to 'priority' clause must be a non-negative integer value}}
44   foo();
45 
46   return tmain(argc, argv);
47 }
48