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