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/target_data_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/target_data_if_messages.cpp')
-rw-r--r-- | clang/test/OpenMP/target_data_if_messages.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/OpenMP/target_data_if_messages.cpp b/clang/test/OpenMP/target_data_if_messages.cpp index 3a0e815798f..38008dd30fe 100644 --- a/clang/test/OpenMP/target_data_if_messages.cpp +++ b/clang/test/OpenMP/target_data_if_messages.cpp @@ -20,6 +20,12 @@ int main(int argc, char **argv) { #pragma omp target data if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp target data' cannot contain more than one 'if' clause}} #pragma omp target data if (S1) // expected-error {{'S1' does not refer to a value}} #pragma omp target data if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp target data if(target data : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp target data if(target data : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp target data if(target data : argc) + #pragma omp target data if(target data : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp target data'}} + #pragma omp target data if(target data : argc) if (target data:argc) // expected-error {{directive '#pragma omp target data' cannot contain more than one 'if' clause with 'target data' name modifier}} + #pragma omp target data if(target data : argc) if (argc) // expected-error {{no more 'if' clause is allowed}} foo(); return 0; |