1*14a388f4SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized 2*14a388f4SAlexey Bataev 3*14a388f4SAlexey Bataev // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized 4*14a388f4SAlexey Bataev foo()5*14a388f4SAlexey Bataevvoid foo() { 6*14a388f4SAlexey Bataev } 7*14a388f4SAlexey Bataev foobool(int argc)8*14a388f4SAlexey Bataevbool foobool(int argc) { 9*14a388f4SAlexey Bataev return argc; 10*14a388f4SAlexey Bataev } 11*14a388f4SAlexey Bataev 12*14a388f4SAlexey Bataev struct S1; // expected-note {{declared here}} 13*14a388f4SAlexey Bataev 14*14a388f4SAlexey Bataev template <class T, class S> // expected-note {{declared here}} tmain(T argc,S ** argv)15*14a388f4SAlexey Bataevint tmain(T argc, S **argv) { 16*14a388f4SAlexey Bataev T z; 17*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks // expected-error {{expected '(' after 'num_tasks'}} 18*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 19*14a388f4SAlexey Bataev foo(); 20*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} 21*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 22*14a388f4SAlexey Bataev foo(); 23*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks () // expected-error {{expected expression}} 24*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 25*14a388f4SAlexey Bataev foo(); 26*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks (argc // expected-error {{expected ')'}} expected-note {{to match this '('}} 27*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 28*14a388f4SAlexey Bataev foo(); 29*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}} 30*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 31*14a388f4SAlexey Bataev foo(); 32*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks (argc > 0 ? argv[1][0] : argv[2][argc] + z) 33*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 34*14a388f4SAlexey Bataev foo(); 35*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks (foobool(argc)), num_tasks (true) // expected-error {{directive '#pragma omp parallel master taskloop simd' cannot contain more than one 'num_tasks' clause}} 36*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 37*14a388f4SAlexey Bataev foo(); 38*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks (S) // expected-error {{'S' does not refer to a value}} 39*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 40*14a388f4SAlexey Bataev foo(); 41*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}} 42*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 43*14a388f4SAlexey Bataev foo(); 44*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks(0) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}} 45*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 46*14a388f4SAlexey Bataev foo(); 47*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks(-1) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}} 48*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 49*14a388f4SAlexey Bataev foo(); 50*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks(argc) grainsize(argc) // expected-error {{'grainsize' and 'num_tasks' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'num_tasks' clause is specified here}} 51*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 52*14a388f4SAlexey Bataev foo(); 53*14a388f4SAlexey Bataev 54*14a388f4SAlexey Bataev return 0; 55*14a388f4SAlexey Bataev } 56*14a388f4SAlexey Bataev main(int argc,char ** argv)57*14a388f4SAlexey Bataevint main(int argc, char **argv) { 58*14a388f4SAlexey Bataev int z; 59*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks // expected-error {{expected '(' after 'num_tasks'}} 60*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 61*14a388f4SAlexey Bataev foo(); 62*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} 63*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 64*14a388f4SAlexey Bataev foo(); 65*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks () // expected-error {{expected expression}} 66*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 67*14a388f4SAlexey Bataev foo(); 68*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks (argc // expected-error {{expected ')'}} expected-note {{to match this '('}} 69*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 70*14a388f4SAlexey Bataev foo(); 71*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}} 72*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 73*14a388f4SAlexey Bataev foo(); 74*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks (argc > 0 ? argv[1][0] : argv[2][argc] - z) 75*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 76*14a388f4SAlexey Bataev foo(); 77*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks (foobool(argc)), num_tasks (true) // expected-error {{directive '#pragma omp parallel master taskloop simd' cannot contain more than one 'num_tasks' clause}} 78*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 79*14a388f4SAlexey Bataev foo(); 80*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks (S1) // expected-error {{'S1' does not refer to a value}} 81*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 82*14a388f4SAlexey Bataev foo(); 83*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}} 84*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 85*14a388f4SAlexey Bataev foo(); 86*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}} 87*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 88*14a388f4SAlexey Bataev foo(); 89*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} 90*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 91*14a388f4SAlexey Bataev foo(); 92*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks(0) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}} 93*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 94*14a388f4SAlexey Bataev foo(); 95*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks(-1) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}} 96*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 97*14a388f4SAlexey Bataev foo(); 98*14a388f4SAlexey Bataev #pragma omp parallel master taskloop simd num_tasks(argc) grainsize(argc) // expected-error {{'grainsize' and 'num_tasks' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'num_tasks' clause is specified here}} 99*14a388f4SAlexey Bataev for (int i = 0; i < 10; ++i) 100*14a388f4SAlexey Bataev foo(); 101*14a388f4SAlexey Bataev 102*14a388f4SAlexey Bataev return tmain(argc, argv); 103*14a388f4SAlexey Bataev } 104