master_taskloop_simd_priority_messages.cpp 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 simd priority // expected-error {{expected '(' after 'priority'}}
  13. for (int i = 0; i < 10; ++i)
  14. foo();
  15. #pragma omp master taskloop simd priority ( // 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 simd priority () // expected-error {{expected expression}}
  19. for (int i = 0; i < 10; ++i)
  20. foo();
  21. #pragma omp master taskloop simd priority (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
  22. for (int i = 0; i < 10; ++i)
  23. foo();
  24. #pragma omp master taskloop simd priority (argc + z)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
  25. for (int i = 0; i < 10; ++i)
  26. foo();
  27. #pragma omp master taskloop simd priority (argc > 0 ? argv[1][0] : argv[2][argc])
  28. for (int i = 0; i < 10; ++i)
  29. foo();
  30. #pragma omp master taskloop simd priority (foobool(argc)), priority (true) // expected-error {{directive '#pragma omp master taskloop simd' cannot contain more than one 'priority' clause}}
  31. for (int i = 0; i < 10; ++i)
  32. foo();
  33. #pragma omp master taskloop simd priority (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 simd priority (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  37. for (int i = 0; i < 10; ++i)
  38. foo();
  39. #pragma omp master taskloop simd priority(0)
  40. for (int i = 0; i < 10; ++i)
  41. foo();
  42. #pragma omp master taskloop simd priority(-1) // expected-error {{argument to 'priority' clause must be a non-negative integer value}}
  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 simd priority // expected-error {{expected '(' after 'priority'}}
  50. for (int i = 0; i < 10; ++i)
  51. foo();
  52. #pragma omp master taskloop simd priority ( // 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 simd priority () // expected-error {{expected expression}}
  56. for (int i = 0; i < 10; ++i)
  57. foo();
  58. #pragma omp master taskloop simd priority (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
  59. for (int i = 0; i < 10; ++i)
  60. foo();
  61. #pragma omp master taskloop simd priority (argc + z)) // expected-warning {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
  62. for (int i = 0; i < 10; ++i)
  63. foo();
  64. #pragma omp master taskloop simd priority (argc > 0 ? argv[1][0] : argv[2][argc])
  65. for (int i = 0; i < 10; ++i)
  66. foo();
  67. #pragma omp master taskloop simd priority (foobool(argc)), priority (true) // expected-error {{directive '#pragma omp master taskloop simd' cannot contain more than one 'priority' clause}}
  68. for (int i = 0; i < 10; ++i)
  69. foo();
  70. #pragma omp master taskloop simd priority (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 simd priority (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  74. for (int i = 0; i < 10; ++i)
  75. foo();
  76. #pragma omp master taskloop simd priority (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  77. for (int i = 0; i < 10; ++i)
  78. foo();
  79. #pragma omp master taskloop simd priority(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  80. for (int i = 0; i < 10; ++i)
  81. foo();
  82. #pragma omp master taskloop simd priority(0)
  83. for (int i = 0; i < 10; ++i)
  84. foo();
  85. #pragma omp master taskloop simd priority(-1) // expected-error {{argument to 'priority' clause must be a non-negative integer value}}
  86. for (int i = 0; i < 10; ++i)
  87. foo();
  88. return tmain(argc, argv);
  89. }