1 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s 2 3 void foo(); 4 5 template <class T, typename S, int N> 6 T tmain(T argc, S **argv) { 7 T i; 8 #pragma omp target 9 #pragma omp teams 10 #pragma omp distribute parallel for proc_bind // expected-error {{expected '(' after 'proc_bind'}} 11 for (i = 0; i < argc; ++i) 12 foo(); 13 #pragma omp target 14 #pragma omp teams 15 #pragma omp distribute parallel for proc_bind( // expected-error {{expected 'master', 'close' or 'spread' in OpenMP clause 'proc_bind'}} expected-error {{expected ')'}} expected-note {{to match this '('}} 16 for (i = 0; i < argc; ++i) 17 foo(); 18 #pragma omp target 19 #pragma omp teams 20 #pragma omp distribute parallel for proc_bind() // expected-error {{expected 'master', 'close' or 'spread' in OpenMP clause 'proc_bind'}} 21 for (i = 0; i < argc; ++i) 22 foo(); 23 #pragma omp target 24 #pragma omp teams 25 #pragma omp distribute parallel for proc_bind(master // expected-error {{expected ')'}} expected-note {{to match this '('}} 26 for (i = 0; i < argc; ++i) 27 foo(); 28 #pragma omp target 29 #pragma omp teams 30 #pragma omp distribute parallel for proc_bind(close), proc_bind(spread) // expected-error {{directive '#pragma omp distribute parallel for' cannot contain more than one 'proc_bind' clause}} 31 for (i = 0; i < argc; ++i) 32 foo(); 33 #pragma omp target 34 #pragma omp teams 35 #pragma omp distribute parallel for proc_bind(x) // expected-error {{expected 'master', 'close' or 'spread' in OpenMP clause 'proc_bind'}} 36 for (i = 0; i < argc; ++i) 37 foo(); 38 39 #pragma omp target 40 #pragma omp teams 41 #pragma omp distribute parallel for proc_bind(master) 42 for (i = 0; i < argc; ++i) 43 foo(); 44 45 #pragma omp parallel proc_bind(close) 46 #pragma omp target 47 #pragma omp teams 48 #pragma omp distribute parallel for proc_bind(spread) 49 for (i = 0; i < argc; ++i) 50 foo(); 51 52 return T(); 53 } 54 55 int main(int argc, char **argv) { 56 int i; 57 #pragma omp target 58 #pragma omp teams 59 #pragma omp distribute parallel for proc_bind // expected-error {{expected '(' after 'proc_bind'}} 60 for (i = 0; i < argc; ++i) 61 foo(); 62 #pragma omp target 63 #pragma omp teams 64 #pragma omp distribute parallel for proc_bind( // expected-error {{expected 'master', 'close' or 'spread' in OpenMP clause 'proc_bind'}} expected-error {{expected ')'}} expected-note {{to match this '('}} 65 for (i = 0; i < argc; ++i) 66 foo(); 67 #pragma omp target 68 #pragma omp teams 69 #pragma omp distribute parallel for proc_bind() // expected-error {{expected 'master', 'close' or 'spread' in OpenMP clause 'proc_bind'}} 70 for (i = 0; i < argc; ++i) 71 foo(); 72 #pragma omp target 73 #pragma omp teams 74 #pragma omp distribute parallel for proc_bind(master // expected-error {{expected ')'}} expected-note {{to match this '('}} 75 for (i = 0; i < argc; ++i) 76 foo(); 77 #pragma omp target 78 #pragma omp teams 79 #pragma omp distribute parallel for proc_bind(close), proc_bind(spread) // expected-error {{directive '#pragma omp distribute parallel for' cannot contain more than one 'proc_bind' clause}} 80 for (i = 0; i < argc; ++i) 81 foo(); 82 #pragma omp target 83 #pragma omp teams 84 #pragma omp distribute parallel for proc_bind(x) // expected-error {{expected 'master', 'close' or 'spread' in OpenMP clause 'proc_bind'}} 85 for (i = 0; i < argc; ++i) 86 foo(); 87 88 #pragma omp target 89 #pragma omp teams 90 #pragma omp distribute parallel for proc_bind(master) 91 for (i = 0; i < argc; ++i) 92 foo(); 93 94 #pragma omp parallel proc_bind(close) 95 #pragma omp target 96 #pragma omp teams 97 #pragma omp distribute parallel for proc_bind(spread) 98 for (i = 0; i < argc; ++i) 99 foo(); 100 return tmain<int, char, 3>(argc, argv); 101 } 102