diff options
author | dim <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
commit | 3176e97f130184ece0e1a21352c8124cc83ff24a (patch) | |
tree | 0a5b74c0b9ca73aded34df95c91fcaf3815230d8 /test/OpenMP/ordered_messages.cpp | |
parent | 1e9b8d38881c3213d1e67b0c47ab9b2c00721a5c (diff) | |
download | FreeBSD-src-3176e97f130184ece0e1a21352c8124cc83ff24a.zip FreeBSD-src-3176e97f130184ece0e1a21352c8124cc83ff24a.tar.gz |
Vendor import of clang trunk r256633:
https://llvm.org/svn/llvm-project/cfe/trunk@256633
Diffstat (limited to 'test/OpenMP/ordered_messages.cpp')
-rw-r--r-- | test/OpenMP/ordered_messages.cpp | 213 |
1 files changed, 211 insertions, 2 deletions
diff --git a/test/OpenMP/ordered_messages.cpp b/test/OpenMP/ordered_messages.cpp index 72e59b7..36f9bb2 100644 --- a/test/OpenMP/ordered_messages.cpp +++ b/test/OpenMP/ordered_messages.cpp @@ -4,6 +4,7 @@ int foo(); template <class T> T foo() { + T k; #pragma omp for ordered for (int i = 0; i < 10; ++i) { L1: @@ -24,11 +25,115 @@ T foo() { foo(); } } - + #pragma omp for ordered + for (int i = 0; i < 10; ++i) { + #pragma omp ordered threads threads // expected-error {{directive '#pragma omp ordered' cannot contain more than one 'threads' clause}} + { + foo(); + } + } + #pragma omp for ordered(1) // expected-note {{'ordered' clause with specified parameter}} + for (int i = 0; i < 10; ++i) { + #pragma omp ordered // expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} + { + foo(); + } + } + #pragma omp for ordered(1) // expected-note {{'ordered' clause with specified parameter}} + for (int i = 0; i < 10; ++i) { + #pragma omp ordered threads // expected-error {{'ordered' directive with 'threads' clause cannot be closely nested inside ordered region with specified parameter}} + { + foo(); + } + } + #pragma omp ordered simd simd // expected-error {{directive '#pragma omp ordered' cannot contain more than one 'simd' clause}} + { + foo(); + } + #pragma omp simd + for (int i = 0; i < 10; ++i) { + #pragma omp ordered // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + foo(); + } + } + #pragma omp simd + for (int i = 0; i < 10; ++i) { + #pragma omp ordered threads // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + foo(); + } + } + #pragma omp for simd + for (int i = 0; i < 10; ++i) { + #pragma omp ordered // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + foo(); + } + } + #pragma omp for simd + for (int i = 0; i < 10; ++i) { + #pragma omp ordered threads // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + foo(); + } + } + #pragma omp parallel for simd + for (int i = 0; i < 10; ++i) { + #pragma omp ordered // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + foo(); + } + } + #pragma omp parallel for simd + for (int i = 0; i < 10; ++i) { + #pragma omp ordered threads // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + foo(); + } + #pragma omp ordered depend(source) // expected-error {{OpenMP constructs may not be nested inside a simd region}} + } +#pragma omp parallel for ordered + for (int i = 0; i < 10; ++i) { + #pragma omp ordered depend(source) // expected-error {{'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter}} + #pragma omp ordered depend(sink : i) // expected-error {{'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter}} + } +#pragma omp parallel for ordered(2) // expected-note 5 {{'ordered' clause with specified parameter}} + for (int i = 0; i < 10; ++i) { + for (int j = 0; j < 10; ++j) { +#pragma omp ordered depend // expected-error {{expected '(' after 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} +#pragma omp ordered depend( // expected-error {{expected ')'}} expected-error {{expected 'source' or 'sink' in OpenMP clause 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} expected-warning {{missing ':' or ')' after dependency type - ignoring}} expected-note {{to match this '('}} +#pragma omp ordered depend(source // expected-error {{expected ')'}} expected-note {{to match this '('}} +#pragma omp ordered depend(sink // expected-error {{expected expression}} expected-warning {{missing ':' or ')' after dependency type - ignoring}} expected-error {{expected ')'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} expected-note {{to match this '('}} +#pragma omp ordered depend(sink : // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} +#pragma omp ordered depend(sink : i // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'j' loop iteration variable}} +#pragma omp ordered depend(sink : i) // expected-error {{expected 'j' loop iteration variable}} +#pragma omp ordered depend(source) + if (i == j) +#pragma omp ordered depend(source) // expected-error {{'#pragma omp ordered' with 'depend' clause cannot be an immediate substatement}} + ; + if (i == j) +#pragma omp ordered depend(sink : i, j) // expected-error {{'#pragma omp ordered' with 'depend' clause cannot be an immediate substatement}} + ; +#pragma omp ordered depend(source) threads // expected-error {{'depend' clauses cannot be mixed with 'threads' clause}} +#pragma omp ordered simd depend(source) // expected-error {{'depend' clauses cannot be mixed with 'simd' clause}} +#pragma omp ordered depend(source) depend(source) // expected-error {{directive '#pragma omp ordered' cannot contain more than one 'depend' clause with 'source' dependence}} +#pragma omp ordered depend(in : i) // expected-error {{expected 'source' or 'sink' in OpenMP clause 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} +#pragma omp ordered depend(sink : i, j) +#pragma omp ordered depend(sink : j, i) // expected-error {{expected 'i' loop iteration variable}} expected-error {{expected 'j' loop iteration variable}} +#pragma omp ordered depend(sink : i, j, k) // expected-error {{unexpected expression: number of expressions is larger than the number of associated loops}} +#pragma omp ordered depend(sink : i+foo(), j/4) // expected-error {{expression is not an integral constant expression}} expected-error {{expected '+' or '-' operation}} +#pragma omp ordered depend(sink : i*0, j-4)// expected-error {{expected '+' or '-' operation}} +#pragma omp ordered depend(sink : i-0, j+sizeof(T)) depend(sink : i-0, j+sizeof(T)) +#pragma omp ordered depend(sink : i-0, j+sizeof(T)) depend(source) // expected-error {{'depend(source)' clause cannot be mixed with 'depend(sink:vec)' clauses}} +#pragma omp ordered depend(source) depend(sink : i-0, j+sizeof(T)) // expected-error {{'depend(sink:vec)' clauses cannot be mixed with 'depend(source)' clause}} + } + } return T(); } int foo() { +int k; #pragma omp for ordered for (int i = 0; i < 10; ++i) { L1: @@ -49,6 +154,110 @@ int foo() { foo(); } } + #pragma omp for ordered + for (int i = 0; i < 10; ++i) { + #pragma omp ordered threads threads // expected-error {{directive '#pragma omp ordered' cannot contain more than one 'threads' clause}} + { + foo(); + } + } + #pragma omp for ordered(1) // expected-note {{'ordered' clause with specified parameter}} + for (int i = 0; i < 10; ++i) { + #pragma omp ordered // expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} + { + foo(); + } + } + #pragma omp for ordered(1) // expected-note {{'ordered' clause with specified parameter}} + for (int i = 0; i < 10; ++i) { + #pragma omp ordered threads // expected-error {{'ordered' directive with 'threads' clause cannot be closely nested inside ordered region with specified parameter}} + { + foo(); + } + } + #pragma omp ordered simd simd // expected-error {{directive '#pragma omp ordered' cannot contain more than one 'simd' clause}} + { + foo(); + } + #pragma omp simd + for (int i = 0; i < 10; ++i) { + #pragma omp ordered // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + foo(); + } + } + #pragma omp simd + for (int i = 0; i < 10; ++i) { + #pragma omp ordered threads // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + foo(); + } + } + #pragma omp for simd + for (int i = 0; i < 10; ++i) { + #pragma omp ordered // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + foo(); + } + } + #pragma omp for simd + for (int i = 0; i < 10; ++i) { + #pragma omp ordered threads // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + foo(); + } + } + #pragma omp parallel for simd + for (int i = 0; i < 10; ++i) { + #pragma omp ordered // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + foo(); + } + } + #pragma omp parallel for simd + for (int i = 0; i < 10; ++i) { + #pragma omp ordered threads // expected-error {{OpenMP constructs may not be nested inside a simd region}} + { + foo(); + } + #pragma omp ordered depend(source) // expected-error {{OpenMP constructs may not be nested inside a simd region}} + } +#pragma omp parallel for ordered + for (int i = 0; i < 10; ++i) { + #pragma omp ordered depend(source) // expected-error {{'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter}} + #pragma omp ordered depend(sink : i) // expected-error {{'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter}} + } +#pragma omp parallel for ordered(2) // expected-note 5 {{'ordered' clause with specified parameter}} + for (int i = 0; i < 10; ++i) { + for (int j = 0; j < 10; ++j) { +#pragma omp ordered depend // expected-error {{expected '(' after 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} +#pragma omp ordered depend( // expected-error {{expected ')'}} expected-error {{expected 'source' or 'sink' in OpenMP clause 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} expected-warning {{missing ':' or ')' after dependency type - ignoring}} expected-note {{to match this '('}} +#pragma omp ordered depend(source // expected-error {{expected ')'}} expected-note {{to match this '('}} +#pragma omp ordered depend(sink // expected-error {{expected expression}} expected-warning {{missing ':' or ')' after dependency type - ignoring}} expected-error {{expected ')'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} expected-note {{to match this '('}} +#pragma omp ordered depend(sink : // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} +#pragma omp ordered depend(sink : i // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected 'j' loop iteration variable}} +#pragma omp ordered depend(sink : i) // expected-error {{expected 'j' loop iteration variable}} +#pragma omp ordered depend(source) + if (i == j) +#pragma omp ordered depend(source) // expected-error {{'#pragma omp ordered' with 'depend' clause cannot be an immediate substatement}} + ; + if (i == j) +#pragma omp ordered depend(sink : i, j) // expected-error {{'#pragma omp ordered' with 'depend' clause cannot be an immediate substatement}} + ; +#pragma omp ordered depend(source) threads // expected-error {{'depend' clauses cannot be mixed with 'threads' clause}} +#pragma omp ordered simd depend(source) // expected-error {{'depend' clauses cannot be mixed with 'simd' clause}} +#pragma omp ordered depend(source) depend(source) // expected-error {{directive '#pragma omp ordered' cannot contain more than one 'depend' clause with 'source' dependence}} +#pragma omp ordered depend(in : i) // expected-error {{expected 'source' or 'sink' in OpenMP clause 'depend'}} expected-error {{'ordered' directive without any clauses cannot be closely nested inside ordered region with specified parameter}} +#pragma omp ordered depend(sink : i, j) +#pragma omp ordered depend(sink : j, i) // expected-error {{expected 'i' loop iteration variable}} expected-error {{expected 'j' loop iteration variable}} +#pragma omp ordered depend(sink : i, j, k) // expected-error {{unexpected expression: number of expressions is larger than the number of associated loops}} +#pragma omp ordered depend(sink : i+foo(), j/4) // expected-error {{expression is not an integral constant expression}} expected-error {{expected '+' or '-' operation}} +#pragma omp ordered depend(sink : i*0, j-4)// expected-error {{expected '+' or '-' operation}} +#pragma omp ordered depend(sink : i-0, j+sizeof(int)) depend(sink : i-0, j+sizeof(int)) +#pragma omp ordered depend(sink : i-0, j+sizeof(int)) depend(source) // expected-error {{'depend(source)' clause cannot be mixed with 'depend(sink:vec)' clauses}} +#pragma omp ordered depend(source) depend(sink : i-0, j+sizeof(int)) // expected-error {{'depend(sink:vec)' clauses cannot be mixed with 'depend(source)' clause}} + } + } - return foo<int>(); + return foo<int>(); // expected-note {{in instantiation of function template specialization 'foo<int>' requested here}} } |