diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-09-03 07:23:48 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-09-03 07:23:48 +0000 |
commit | 878fd7ec174af3cbfb26977ca93d98dd0f8280f3 (patch) | |
tree | 2c52d099d0c74eec15f994099ec8cb8cfaa94914 /test/OpenMP/parallel_for_schedule_messages.cpp | |
parent | fbd2901a30d987614df74465e21879e268f2d3ea (diff) |
[OPENMP 4.1] Parsing/sema analysis for extended format of 'if' clause.
OpenMP 4.1 added special 'directive-name-modifier' to the 'if' clause.
Format of 'if' clause is as follows:
```
if([ directive-name-modifier :] scalar-logical-expression)
```
The restriction rules are also changed.
1. If any 'if' clause on the directive includes a 'directive-name-modifier' then all 'if' clauses on the directive must include a 'directive-name-modifier'.
2. At most one 'if' clause without a 'directive-name-modifier' can appear on the directive.
3. At most one 'if' clause with some particular 'directive-name-modifier' can appear on the directive.
'directive-name-modifier' is important for combined directives and allows to separate conditions in 'if' clause for simple sub-directives in combined directive. This 'directive-name-modifier' identifies the sub-directive to which this 'if' clause must be applied.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246747 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/OpenMP/parallel_for_schedule_messages.cpp')
-rw-r--r-- | test/OpenMP/parallel_for_schedule_messages.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/OpenMP/parallel_for_schedule_messages.cpp b/test/OpenMP/parallel_for_schedule_messages.cpp index c12c428268..5ed6dc8883 100644 --- a/test/OpenMP/parallel_for_schedule_messages.cpp +++ b/test/OpenMP/parallel_for_schedule_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { // expected-error@+1 {{argument to 'schedule' clause must be a positive integer value}} #pragma omp parallel for schedule (static, foobool(argc)), schedule (dynamic, true), schedule (guided, -5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; - #pragma omp parallel for schedule (static, S) // expected-error {{'S' does not refer to a value}} expected-warning {{extra tokens at the end of '#pragma omp parallel for' are ignored}} + #pragma omp parallel for schedule (static, S) // expected-error {{'S' does not refer to a value}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+1 2 {{expression must have integral or unscoped enumeration type, not 'char *'}} #pragma omp parallel for schedule (guided, argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} @@ -76,14 +76,14 @@ int main(int argc, char **argv) { // expected-error@+1 {{argument to 'schedule' clause must be a positive integer value}} #pragma omp parallel for schedule (guided, foobool(argc)), schedule (static, true), schedule (dynamic, -5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; - #pragma omp parallel for schedule (guided, S1) // expected-error {{'S1' does not refer to a value}} expected-warning {{extra tokens at the end of '#pragma omp parallel for' are ignored}} + #pragma omp parallel for schedule (guided, S1) // expected-error {{'S1' does not refer to a value}} for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error@+1 {{expression must have integral or unscoped enumeration type, not 'char *'}} #pragma omp parallel for schedule (static, argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error@+3 {{statement after '#pragma omp parallel for' must be a for loop}} // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, -1, -2>' requested here}} - #pragma omp parallel for schedule(dynamic, schedule(tmain<int, char, -1, -2>(argc, argv) // expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp parallel for schedule(dynamic, schedule(tmain<int, char, -1, -2>(argc, argv) // expected-error 2 {{expected ')'}} expected-note 2 {{to match this '('}} foo(); // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, 1, 0>' requested here}} return tmain<int, char, 1, 0>(argc, argv); |