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 | 6b8046addfce08aa075f0db860f8a5a29fd6e45f (patch) | |
tree | 0590b52d3fa9f08eb5fe3b86828cbcd3931a1bcd /clang/test/OpenMP/task_if_messages.cpp | |
parent | 49948af9cd20eea2b9a504dbb25b2779e507c57f (diff) | |
download | bcm5719-llvm-6b8046addfce08aa075f0db860f8a5a29fd6e45f.tar.gz bcm5719-llvm-6b8046addfce08aa075f0db860f8a5a29fd6e45f.zip |
[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.
llvm-svn: 246747
Diffstat (limited to 'clang/test/OpenMP/task_if_messages.cpp')
-rw-r--r-- | clang/test/OpenMP/task_if_messages.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/OpenMP/task_if_messages.cpp b/clang/test/OpenMP/task_if_messages.cpp index ae6bb13093d..029e4e1f1b7 100644 --- a/clang/test/OpenMP/task_if_messages.cpp +++ b/clang/test/OpenMP/task_if_messages.cpp @@ -22,6 +22,12 @@ int tmain(T argc, S **argv) { #pragma omp task if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} #pragma omp task if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}} #pragma omp task if(argc) + #pragma omp task if(task : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp task if(task : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp task if(task : argc) + #pragma omp task if(task : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp task'}} + #pragma omp task if(task : argc) if (task:argc) // expected-error {{directive '#pragma omp task' cannot contain more than one 'if' clause with 'task' name modifier}} + #pragma omp task if(task : argc) if (argc) // expected-error {{no more 'if' clause is allowed}} foo(); return 0; @@ -40,6 +46,12 @@ int main(int argc, char **argv) { #pragma omp task if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}} #pragma omp task if (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}} #pragma omp task if(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp task if(task : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp task if(task : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp task if(task : argc) + #pragma omp task if(task : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp task'}} + #pragma omp task if(task : argc) if (task:argc) // expected-error {{directive '#pragma omp task' cannot contain more than one 'if' clause with 'task' name modifier}} + #pragma omp task if(task : argc) if (argc) // expected-error {{no more 'if' clause is allowed}} foo(); return tmain(argc, argv); |