master_taskloop_final_messages.cpp 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
  2. // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
  3. void foo() {
  4. }
  5. bool foobool(int argc) {
  6. return argc;
  7. }
  8. struct S1; // expected-note {{declared here}}
  9. template <class T, class S> // expected-note {{declared here}}
  10. int tmain(T argc, S **argv) {
  11. T z;
  12. #pragma omp master taskloop final // expected-error {{expected '(' after 'final'}}
  13. for (int i = 0; i < 10; ++i)
  14. foo();
  15. #pragma omp master taskloop final( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  16. for (int i = 0; i < 10; ++i)
  17. foo();
  18. #pragma omp master taskloop final() // expected-error {{expected expression}}
  19. for (int i = 0; i < 10; ++i)
  20. foo();
  21. #pragma omp master taskloop final(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
  22. for (int i = 0; i < 10; ++i)
  23. foo();
  24. #pragma omp master taskloop final(argc)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
  25. for (int i = 0; i < 10; ++i)
  26. foo();
  27. #pragma omp master taskloop final(argc > 0 ? argv[1] : argv[2] + z)
  28. for (int i = 0; i < 10; ++i)
  29. foo();
  30. #pragma omp master taskloop final(foobool(argc)), final(true) // expected-error {{directive '#pragma omp master taskloop' cannot contain more than one 'final' clause}}
  31. for (int i = 0; i < 10; ++i)
  32. foo();
  33. #pragma omp master taskloop final(S) // expected-error {{'S' does not refer to a value}}
  34. for (int i = 0; i < 10; ++i)
  35. foo();
  36. #pragma omp master taskloop final(argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  37. for (int i = 0; i < 10; ++i)
  38. foo();
  39. #pragma omp master taskloop final(argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  40. for (int i = 0; i < 10; ++i)
  41. foo();
  42. #pragma omp master taskloop final(argc)
  43. for (int i = 0; i < 10; ++i)
  44. foo();
  45. return 0;
  46. }
  47. int main(int argc, char **argv) {
  48. int z;
  49. #pragma omp master taskloop final // expected-error {{expected '(' after 'final'}}
  50. for (int i = 0; i < 10; ++i)
  51. foo();
  52. #pragma omp master taskloop final( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  53. for (int i = 0; i < 10; ++i)
  54. foo();
  55. #pragma omp master taskloop final() // expected-error {{expected expression}}
  56. for (int i = 0; i < 10; ++i)
  57. foo();
  58. #pragma omp master taskloop final(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
  59. for (int i = 0; i < 10; ++i)
  60. foo();
  61. #pragma omp master taskloop final(argc)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
  62. for (int i = 0; i < 10; ++i)
  63. foo();
  64. #pragma omp master taskloop final(argc > 0 ? argv[1] : argv[2] - z)
  65. for (int i = 0; i < 10; ++i)
  66. foo();
  67. #pragma omp master taskloop final(foobool(argc)), final(true) // expected-error {{directive '#pragma omp master taskloop' cannot contain more than one 'final' clause}}
  68. for (int i = 0; i < 10; ++i)
  69. foo();
  70. #pragma omp master taskloop final(S1) // expected-error {{'S1' does not refer to a value}}
  71. for (int i = 0; i < 10; ++i)
  72. foo();
  73. #pragma omp master taskloop final(argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  74. for (int i = 0; i < 10; ++i)
  75. foo();
  76. #pragma omp master taskloop final(argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  77. for (int i = 0; i < 10; ++i)
  78. foo();
  79. #pragma omp master taskloop final(1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  80. for (int i = 0; i < 10; ++i)
  81. foo();
  82. #pragma omp master taskloop final(if (tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  83. for (int i = 0; i < 10; ++i)
  84. foo();
  85. return tmain(argc, argv);
  86. }