From: Joel E. Denny Date: Tue, 23 Apr 2019 17:04:15 +0000 (+0000) Subject: [APSInt][OpenMP] Fix isNegative, etc. for unsigned types X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4d8e7b3dae79488ffa99d70cdcf1f48ad1cde845;p=clang [APSInt][OpenMP] Fix isNegative, etc. for unsigned types Without this patch, APSInt inherits APInt::isNegative, which merely checks the sign bit without regard to whether the type is actually signed. isNonNegative and isStrictlyPositive call isNegative and so are also affected. This patch adjusts APSInt to override isNegative, isNonNegative, and isStrictlyPositive with implementations that consider whether the type is signed. A large set of Clang OpenMP tests are affected. Without this patch, these tests assume that `true` is not a valid argument for clauses like `collapse`. Indeed, `true` fails APInt::isStrictlyPositive but not APSInt::isStrictlyPositive. This patch adjusts those tests to assume `true` should be accepted. This patch also adds tests revealing various other similar fixes due to APSInt::isNegative calls in Clang's ExprConstant.cpp and SemaExpr.cpp: `++` and `--` overflow in `constexpr`, evaluated object size based on `alloc_size`, `<<` and `>>` shift count validation, and OpenMP array section validation. Reviewed By: lebedev.ri, ABataev, hfinkel Differential Revision: https://reviews.llvm.org/D59712 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359012 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/alloc-size.c b/test/CodeGen/alloc-size.c index aa5b295b0c..16cc0fe118 100644 --- a/test/CodeGen/alloc-size.c +++ b/test/CodeGen/alloc-size.c @@ -357,3 +357,12 @@ void test12() { // CHECK: store i32 -1 gi = OBJECT_SIZE_BUILTIN(my_signed_calloc(-2, 1), 0); } + +void *alloc_uchar(unsigned char) __attribute__((alloc_size(1))); + +// CHECK-LABEL: @test13 +void test13() { + // If 128 were incorrectly seen as negative, the result would become -1. + // CHECK: store i32 128, + gi = OBJECT_SIZE_BUILTIN(alloc_uchar(128), 0); +} diff --git a/test/OpenMP/distribute_collapse_messages.cpp b/test/OpenMP/distribute_collapse_messages.cpp index b852fd2826..e4164daaed 100644 --- a/test/OpenMP/distribute_collapse_messages.cpp +++ b/test/OpenMP/distribute_collapse_messages.cpp @@ -42,7 +42,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+3 2 {{directive '#pragma omp distribute' cannot contain more than one 'collapse' clause}} - // expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+1 2 {{expression is not an integral constant expression}} #pragma omp distribute collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -85,7 +85,7 @@ int main(int argc, char **argv) { #endif // expected-error@+3 {{expression is not an integral constant expression}} // expected-error@+2 2 {{directive '#pragma omp distribute' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp distribute collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp distribute collapse (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/distribute_parallel_for_collapse_messages.cpp b/test/OpenMP/distribute_parallel_for_collapse_messages.cpp index f01dfeea5c..c3298f1756 100644 --- a/test/OpenMP/distribute_parallel_for_collapse_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_collapse_messages.cpp @@ -53,7 +53,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp distribute parallel for collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp distribute parallel for', but found only 1}} // expected-error@+8 2 {{directive '#pragma omp distribute parallel for' cannot contain more than one 'collapse' clause}} - // expected-error@+7 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+7 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+6 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+4 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -124,7 +124,7 @@ int main(int argc, char **argv) { // expected-note@+6{{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+4 2 {{directive '#pragma omp distribute parallel for' cannot contain more than one 'collapse' clause}} - // expected-error@+3 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+3 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target #pragma omp teams #pragma omp distribute parallel for collapse (foobool(argc)), collapse (true), collapse (-5) diff --git a/test/OpenMP/distribute_parallel_for_simd_collapse_messages.cpp b/test/OpenMP/distribute_parallel_for_simd_collapse_messages.cpp index b12dcc19d0..9399594be2 100644 --- a/test/OpenMP/distribute_parallel_for_simd_collapse_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_simd_collapse_messages.cpp @@ -53,7 +53,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp distribute parallel for simd collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp distribute parallel for simd', but found only 1}} // expected-error@+8 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'collapse' clause}} - // expected-error@+7 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+7 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+6 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+4 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -124,7 +124,7 @@ int main(int argc, char **argv) { // expected-note@+6{{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+4 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'collapse' clause}} - // expected-error@+3 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+3 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target #pragma omp teams #pragma omp distribute parallel for simd collapse (foobool(argc)), collapse (true), collapse (-5) diff --git a/test/OpenMP/distribute_parallel_for_simd_safelen_messages.cpp b/test/OpenMP/distribute_parallel_for_simd_safelen_messages.cpp index 93766f9a6a..7e76c1f6ab 100644 --- a/test/OpenMP/distribute_parallel_for_simd_safelen_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_simd_safelen_messages.cpp @@ -63,11 +63,14 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+4 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+7 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -144,11 +147,14 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+7 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target #pragma omp teams -#pragma omp parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/distribute_parallel_for_simd_simdlen_messages.cpp b/test/OpenMP/distribute_parallel_for_simd_simdlen_messages.cpp index 8e40e3547f..9c1c552033 100644 --- a/test/OpenMP/distribute_parallel_for_simd_simdlen_messages.cpp +++ b/test/OpenMP/distribute_parallel_for_simd_simdlen_messages.cpp @@ -66,11 +66,14 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+4 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+7 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) // expected-error 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'simdlen' clause}} expected-error 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'simdlen' clause}} +// expected-error@+2 {{argument to 'simdlen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp distribute parallel for simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -148,11 +151,14 @@ int main(int argc, char **argv) { #if __cplusplus >= 201103L - // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+7 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) // expected-error {{expression is not an integral constant expression}} expected-error 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'simdlen' clause}} expected-error 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} +// expected-error@+3 {{expression is not an integral constant expression}} +// expected-error@+2 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'simdlen' clause}} +// expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}} +#pragma omp distribute parallel for simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/distribute_simd_collapse_messages.cpp b/test/OpenMP/distribute_simd_collapse_messages.cpp index f4d5b73634..204719a2e6 100644 --- a/test/OpenMP/distribute_simd_collapse_messages.cpp +++ b/test/OpenMP/distribute_simd_collapse_messages.cpp @@ -53,7 +53,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp distribute simd collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp distribute simd', but found only 1}} // expected-error@+8 2 {{directive '#pragma omp distribute simd' cannot contain more than one 'collapse' clause}} - // expected-error@+7 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+7 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+6 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+4 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -124,7 +124,7 @@ int main(int argc, char **argv) { // expected-note@+6{{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+4 2 {{directive '#pragma omp distribute simd' cannot contain more than one 'collapse' clause}} - // expected-error@+3 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+3 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target #pragma omp teams #pragma omp distribute simd collapse (foobool(argc)), collapse (true), collapse (-5) diff --git a/test/OpenMP/distribute_simd_safelen_messages.cpp b/test/OpenMP/distribute_simd_safelen_messages.cpp index c95d121ca2..30c0976368 100644 --- a/test/OpenMP/distribute_simd_safelen_messages.cpp +++ b/test/OpenMP/distribute_simd_safelen_messages.cpp @@ -63,11 +63,14 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+4 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+7 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target #pragma omp teams -#pragma omp distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp distribute simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp distribute simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -144,11 +147,14 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+7 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target #pragma omp teams -#pragma omp parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/distribute_simd_simdlen_messages.cpp b/test/OpenMP/distribute_simd_simdlen_messages.cpp index c95d121ca2..30c0976368 100644 --- a/test/OpenMP/distribute_simd_simdlen_messages.cpp +++ b/test/OpenMP/distribute_simd_simdlen_messages.cpp @@ -63,11 +63,14 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+4 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+7 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target #pragma omp teams -#pragma omp distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp distribute simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp distribute simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -144,11 +147,14 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+7 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target #pragma omp teams -#pragma omp parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/for_collapse_messages.cpp b/test/OpenMP/for_collapse_messages.cpp index 230880b22d..5530ddcc6a 100644 --- a/test/OpenMP/for_collapse_messages.cpp +++ b/test/OpenMP/for_collapse_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp for collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp for', but found only 1}} // expected-error@+6 2 {{directive '#pragma omp for' cannot contain more than one 'collapse' clause}} - // expected-error@+5 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -86,7 +86,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp for' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp for collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp for collapse (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/for_ordered_clause.cpp b/test/OpenMP/for_ordered_clause.cpp index ec29a989d0..7ccf570def 100644 --- a/test/OpenMP/for_ordered_clause.cpp +++ b/test/OpenMP/for_ordered_clause.cpp @@ -47,7 +47,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i - ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp for', but found only 1}} // expected-error@+6 2 {{directive '#pragma omp for' cannot contain more than one 'ordered' clause}} -// expected-error@+5 2 {{argument to 'ordered' clause must be a strictly positive integer value}} +// expected-error@+5 {{argument to 'ordered' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -113,7 +113,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp for' cannot contain more than one 'ordered' clause}} -// expected-error@+1 2 {{argument to 'ordered' clause must be a strictly positive integer value}} +// expected-error@+1 {{argument to 'ordered' clause must be a strictly positive integer value}} #pragma omp for ordered(foobool(argc)), ordered(true), ordered(-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i - 4]; diff --git a/test/OpenMP/for_simd_collapse_messages.cpp b/test/OpenMP/for_simd_collapse_messages.cpp index 9e9b8ee675..f5c130f30a 100644 --- a/test/OpenMP/for_simd_collapse_messages.cpp +++ b/test/OpenMP/for_simd_collapse_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp for simd collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp for simd', but found only 1}} // expected-error@+6 2 {{directive '#pragma omp for simd' cannot contain more than one 'collapse' clause}} - // expected-error@+5 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -86,7 +86,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp for simd' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp for simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp for simd collapse (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/for_simd_safelen_messages.cpp b/test/OpenMP/for_simd_safelen_messages.cpp index 31b0f84cba..6868b938c2 100644 --- a/test/OpenMP/for_simd_safelen_messages.cpp +++ b/test/OpenMP/for_simd_safelen_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp for simd safelen ((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp for simd' cannot contain more than one 'safelen' clause}} - // expected-error@+5 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -84,7 +84,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp for simd' cannot contain more than one 'safelen' clause}} - // expected-error@+1 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}} #pragma omp for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp for simd safelen (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/for_simd_simdlen_messages.cpp b/test/OpenMP/for_simd_simdlen_messages.cpp index 09954283a1..86cc4690a9 100644 --- a/test/OpenMP/for_simd_simdlen_messages.cpp +++ b/test/OpenMP/for_simd_simdlen_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp for simd simdlen ((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp for simd' cannot contain more than one 'simdlen' clause}} - // expected-error@+5 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -84,7 +84,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp for simd' cannot contain more than one 'simdlen' clause}} - // expected-error@+1 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}} #pragma omp for simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp for simd simdlen (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/parallel_for_collapse_messages.cpp b/test/OpenMP/parallel_for_collapse_messages.cpp index 9d99c25efa..192fa45c90 100644 --- a/test/OpenMP/parallel_for_collapse_messages.cpp +++ b/test/OpenMP/parallel_for_collapse_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp parallel for collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp parallel for', but found only 1}} // expected-error@+6 2 {{directive '#pragma omp parallel for' cannot contain more than one 'collapse' clause}} - // expected-error@+5 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -86,7 +86,7 @@ int main(int argc, char **argv) { // expected-note@+4{{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp parallel for' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp parallel for collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp parallel for collapse (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/parallel_for_ordered_messages.cpp b/test/OpenMP/parallel_for_ordered_messages.cpp index 381bc6ae1b..9681d780fb 100644 --- a/test/OpenMP/parallel_for_ordered_messages.cpp +++ b/test/OpenMP/parallel_for_ordered_messages.cpp @@ -46,7 +46,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i - ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp parallel for', but found only 1}} // expected-error@+6 2 {{directive '#pragma omp parallel for' cannot contain more than one 'ordered' clause}} -// expected-error@+5 2 {{argument to 'ordered' clause must be a strictly positive integer value}} +// expected-error@+5 {{argument to 'ordered' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -104,7 +104,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp parallel for' cannot contain more than one 'ordered' clause}} -// expected-error@+1 2 {{argument to 'ordered' clause must be a strictly positive integer value}} +// expected-error@+1 {{argument to 'ordered' clause must be a strictly positive integer value}} #pragma omp parallel for ordered(foobool(argc)), ordered(true), ordered(-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i - 4]; diff --git a/test/OpenMP/parallel_for_simd_collapse_messages.cpp b/test/OpenMP/parallel_for_simd_collapse_messages.cpp index d23086b9e5..39d01b8c2f 100644 --- a/test/OpenMP/parallel_for_simd_collapse_messages.cpp +++ b/test/OpenMP/parallel_for_simd_collapse_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp parallel for simd collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp parallel for simd', but found only 1}} // expected-error@+6 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'collapse' clause}} - // expected-error@+5 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -86,7 +86,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp parallel for simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp parallel for simd collapse (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/parallel_for_simd_safelen_messages.cpp b/test/OpenMP/parallel_for_simd_safelen_messages.cpp index 49ebf428f3..939a1dafb3 100644 --- a/test/OpenMP/parallel_for_simd_safelen_messages.cpp +++ b/test/OpenMP/parallel_for_simd_safelen_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp parallel for simd safelen ((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'safelen' clause}} - // expected-error@+5 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -84,7 +84,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'safelen' clause}} - // expected-error@+1 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}} #pragma omp parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp parallel for simd safelen (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/parallel_for_simd_simdlen_messages.cpp b/test/OpenMP/parallel_for_simd_simdlen_messages.cpp index 167644e388..8cf196bf71 100644 --- a/test/OpenMP/parallel_for_simd_simdlen_messages.cpp +++ b/test/OpenMP/parallel_for_simd_simdlen_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp parallel for simd simdlen ((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'simdlen' clause}} - // expected-error@+5 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -84,7 +84,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp parallel for simd' cannot contain more than one 'simdlen' clause}} - // expected-error@+1 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}} #pragma omp parallel for simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp parallel for simd simdlen (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/simd_collapse_messages.cpp b/test/OpenMP/simd_collapse_messages.cpp index b3100c097d..3e980d9492 100644 --- a/test/OpenMP/simd_collapse_messages.cpp +++ b/test/OpenMP/simd_collapse_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp simd collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp simd', but found only 1}} // expected-error@+6 2 {{directive '#pragma omp simd' cannot contain more than one 'collapse' clause}} - // expected-error@+5 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -86,7 +86,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp simd' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp simd collapse (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/simd_safelen_messages.cpp b/test/OpenMP/simd_safelen_messages.cpp index b75a923e7f..f40873aeea 100644 --- a/test/OpenMP/simd_safelen_messages.cpp +++ b/test/OpenMP/simd_safelen_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp simd safelen ((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp simd' cannot contain more than one 'safelen' clause}} - // expected-error@+5 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -84,7 +84,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp simd' cannot contain more than one 'safelen' clause}} - // expected-error@+1 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}} #pragma omp simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp simd safelen (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/simd_simdlen_messages.cpp b/test/OpenMP/simd_simdlen_messages.cpp index f34d628141..27ab4acf77 100644 --- a/test/OpenMP/simd_simdlen_messages.cpp +++ b/test/OpenMP/simd_simdlen_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp simd simdlen ((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp simd' cannot contain more than one 'simdlen' clause}} - // expected-error@+5 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -84,7 +84,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp simd' cannot contain more than one 'simdlen' clause}} - // expected-error@+1 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}} #pragma omp simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp simd simdlen (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_map_messages.cpp b/test/OpenMP/target_map_messages.cpp index e1967d27c9..04e201d136 100644 --- a/test/OpenMP/target_map_messages.cpp +++ b/test/OpenMP/target_map_messages.cpp @@ -73,6 +73,8 @@ struct SA { {} #pragma omp target map(b[:-1]) // expected-error {{section length is evaluated to a negative value -1}} {} + #pragma omp target map(b[true:true]) + {} #pragma omp target map(: c,f) // expected-error {{missing map type}} {} diff --git a/test/OpenMP/target_parallel_for_collapse_messages.cpp b/test/OpenMP/target_parallel_for_collapse_messages.cpp index d8ebdda81a..2e194ffbd0 100644 --- a/test/OpenMP/target_parallel_for_collapse_messages.cpp +++ b/test/OpenMP/target_parallel_for_collapse_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp target parallel for collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp target parallel for', but found only 1}} // expected-error@+3 2 {{directive '#pragma omp target parallel for' cannot contain more than one 'collapse' clause}} - // expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+1 2 {{expression is not an integral constant expression}} #pragma omp target parallel for collapse (foobool(argc)), collapse (true), collapse (-5) #if __cplusplus >= 201103L @@ -82,7 +82,7 @@ int main(int argc, char **argv) { for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error@+3 {{expression is not an integral constant expression}} // expected-error@+2 2 {{directive '#pragma omp target parallel for' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target parallel for collapse (foobool(argc)), collapse (true), collapse (-5) #if __cplusplus >= 201103L // expected-note@-2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} diff --git a/test/OpenMP/target_parallel_for_map_messages.cpp b/test/OpenMP/target_parallel_for_map_messages.cpp index 8521700b5c..6ef87d442f 100644 --- a/test/OpenMP/target_parallel_for_map_messages.cpp +++ b/test/OpenMP/target_parallel_for_map_messages.cpp @@ -86,6 +86,8 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for map(l[:-1]) // expected-error 2 {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target parallel for map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for map(tofrom: t[:I]) @@ -206,6 +208,8 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for map(l[:-1]) // expected-error {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target parallel for map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for map(to: x) diff --git a/test/OpenMP/target_parallel_for_ordered_messages.cpp b/test/OpenMP/target_parallel_for_ordered_messages.cpp index 002e8e9a5c..38a977e293 100644 --- a/test/OpenMP/target_parallel_for_ordered_messages.cpp +++ b/test/OpenMP/target_parallel_for_ordered_messages.cpp @@ -49,7 +49,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here} // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+3 2 {{directive '#pragma omp target parallel for' cannot contain more than one 'ordered' clause}} -// expected-error@+2 2 {{argument to 'ordered' clause must be a strictly positive integer value}} +// expected-error@+2 {{argument to 'ordered' clause must be a strictly positive integer value}} // expected-error@+1 2 {{expression is not an integral constant expression}} #pragma omp target parallel for ordered(foobool(argc)), ordered(true), ordered(-5) for (int i = ST; i < N; i++) @@ -103,7 +103,7 @@ int main(int argc, char **argv) { #endif // expected-error@+3 {{expression is not an integral constant expression}} // expected-error@+2 2 {{directive '#pragma omp target parallel for' cannot contain more than one 'ordered' clause}} -// expected-error@+1 2 {{argument to 'ordered' clause must be a strictly positive integer value}} +// expected-error@+1 {{argument to 'ordered' clause must be a strictly positive integer value}} #pragma omp target parallel for ordered(foobool(argc)), ordered(true), ordered(-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i - 4]; diff --git a/test/OpenMP/target_parallel_for_simd_collapse_messages.cpp b/test/OpenMP/target_parallel_for_simd_collapse_messages.cpp index f3f2aa9ace..24e30b3d3f 100644 --- a/test/OpenMP/target_parallel_for_simd_collapse_messages.cpp +++ b/test/OpenMP/target_parallel_for_simd_collapse_messages.cpp @@ -43,7 +43,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+3 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'collapse' clause}} - // expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+1 2 {{expression is not an integral constant expression}} #pragma omp target parallel for simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -84,7 +84,7 @@ int main(int argc, char **argv) { #endif // expected-error@+3 {{expression is not an integral constant expression}} // expected-error@+2 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target parallel for simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp target parallel for simd collapse (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_parallel_for_simd_map_messages.cpp b/test/OpenMP/target_parallel_for_simd_map_messages.cpp index 83259cdd3e..f18cc9a5f8 100644 --- a/test/OpenMP/target_parallel_for_simd_map_messages.cpp +++ b/test/OpenMP/target_parallel_for_simd_map_messages.cpp @@ -86,6 +86,8 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd map(l[:-1]) // expected-error 2 {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target parallel for simd map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd map(tofrom: t[:I]) @@ -206,6 +208,8 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel map(l[:-1]) // expected-error {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target parallel map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target parallel for simd map(to: x) diff --git a/test/OpenMP/target_parallel_for_simd_ordered_messages.cpp b/test/OpenMP/target_parallel_for_simd_ordered_messages.cpp index 3e3f6c26c3..08b9247c1b 100644 --- a/test/OpenMP/target_parallel_for_simd_ordered_messages.cpp +++ b/test/OpenMP/target_parallel_for_simd_ordered_messages.cpp @@ -47,7 +47,7 @@ T tmain(T argc, S **argv) { #pragma omp target parallel for simd ordered((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i - ST]; -// expected-error@+3 2 {{argument to 'ordered' clause must be a strictly positive integer value}} +// expected-error@+3 {{argument to 'ordered' clause must be a strictly positive integer value}} // expected-error@+2 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'ordered' clause}} // expected-error@+1 {{'ordered' clause with a parameter can not be specified in '#pragma omp target parallel for simd' directive}} #pragma omp target parallel for simd ordered(foobool(argc)), ordered(true), ordered(-5) @@ -105,7 +105,7 @@ int main(int argc, char **argv) { #endif // expected-error@+3 {{expression is not an integral constant expression}} // expected-error@+2 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'ordered' clause}} -// expected-error@+1 2 {{argument to 'ordered' clause must be a strictly positive integer value}} +// expected-error@+1 {{argument to 'ordered' clause must be a strictly positive integer value}} #pragma omp target parallel for simd ordered(foobool(argc)), ordered(true), ordered(-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i - 4]; diff --git a/test/OpenMP/target_parallel_for_simd_safelen_messages.cpp b/test/OpenMP/target_parallel_for_simd_safelen_messages.cpp index 74b1a7374f..1121593e5e 100644 --- a/test/OpenMP/target_parallel_for_simd_safelen_messages.cpp +++ b/test/OpenMP/target_parallel_for_simd_safelen_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp target parallel for simd safelen ((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'safelen' clause}} - // expected-error@+5 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -84,7 +84,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'safelen' clause}} - // expected-error@+1 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}} #pragma omp target parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp target parallel for simd safelen (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_parallel_for_simd_simdlen_messages.cpp b/test/OpenMP/target_parallel_for_simd_simdlen_messages.cpp index f8b375ef1c..33a6642a8d 100644 --- a/test/OpenMP/target_parallel_for_simd_simdlen_messages.cpp +++ b/test/OpenMP/target_parallel_for_simd_simdlen_messages.cpp @@ -46,7 +46,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'simdlen' clause}} - // expected-error@+5 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -111,7 +111,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'simdlen' clause}} -// expected-error@+1 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} +// expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}} #pragma omp target parallel for simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/target_parallel_map_messages.cpp b/test/OpenMP/target_parallel_map_messages.cpp index 510595cb0b..52774aa741 100644 --- a/test/OpenMP/target_parallel_map_messages.cpp +++ b/test/OpenMP/target_parallel_map_messages.cpp @@ -86,6 +86,8 @@ T tmain(T argc) { foo(); #pragma omp target parallel map(l[:-1]) // expected-error 2 {{section length is evaluated to a negative value -1}} foo(); +#pragma omp target parallel map(l[true:true]) + foo(); #pragma omp target parallel map(x) foo(); #pragma omp target parallel map(tofrom: t[:I]) @@ -205,6 +207,8 @@ int main(int argc, char **argv) { foo(); #pragma omp target parallel map(l[:-1]) // expected-error {{section length is evaluated to a negative value -1}} foo(); +#pragma omp target parallel map(l[true:true]) + foo(); #pragma omp target parallel map(x) foo(); #pragma omp target parallel map(to: x) diff --git a/test/OpenMP/target_simd_collapse_messages.cpp b/test/OpenMP/target_simd_collapse_messages.cpp index 400844152b..8bf2c3bbf7 100644 --- a/test/OpenMP/target_simd_collapse_messages.cpp +++ b/test/OpenMP/target_simd_collapse_messages.cpp @@ -41,7 +41,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+3 2 {{directive '#pragma omp target simd' cannot contain more than one 'collapse' clause}} - // expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+1 2 {{expression is not an integral constant expression}} #pragma omp target simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -82,7 +82,7 @@ int main(int argc, char **argv) { #endif // expected-error@+3 {{expression is not an integral constant expression}} // expected-error@+2 2 {{directive '#pragma omp target simd' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp target simd collapse (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_simd_safelen_messages.cpp b/test/OpenMP/target_simd_safelen_messages.cpp index 69ceab1a68..993d707114 100644 --- a/test/OpenMP/target_simd_safelen_messages.cpp +++ b/test/OpenMP/target_simd_safelen_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp target simd safelen ((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp target simd' cannot contain more than one 'safelen' clause}} - // expected-error@+5 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -84,7 +84,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp target simd' cannot contain more than one 'safelen' clause}} - // expected-error@+1 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}} #pragma omp target simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp target simd safelen (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/target_simd_simdlen_messages.cpp b/test/OpenMP/target_simd_simdlen_messages.cpp index c65fe20d3a..3a6e477886 100644 --- a/test/OpenMP/target_simd_simdlen_messages.cpp +++ b/test/OpenMP/target_simd_simdlen_messages.cpp @@ -46,7 +46,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp target simd' cannot contain more than one 'simdlen' clause}} - // expected-error@+5 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -111,7 +111,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp target simd' cannot contain more than one 'simdlen' clause}} -// expected-error@+1 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} +// expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}} #pragma omp target simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/target_teams_distribute_collapse_messages.cpp b/test/OpenMP/target_teams_distribute_collapse_messages.cpp index 4010c5a9a9..7495a18443 100644 --- a/test/OpenMP/target_teams_distribute_collapse_messages.cpp +++ b/test/OpenMP/target_teams_distribute_collapse_messages.cpp @@ -56,7 +56,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+3 2 {{directive '#pragma omp target teams distribute' cannot contain more than one 'collapse' clause}} -// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+1 2 {{expression is not an integral constant expression}} #pragma omp target teams distribute collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = ST; i < N; i++) @@ -122,7 +122,7 @@ int main(int argc, char **argv) { #endif // expected-error@+3 {{expression is not an integral constant expression}} // expected-error@+2 2 {{directive '#pragma omp target teams distribute' cannot contain more than one 'collapse' clause}} -// expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target teams distribute collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/target_teams_distribute_map_messages.cpp b/test/OpenMP/target_teams_distribute_map_messages.cpp index e4c1d0f898..0de429736e 100644 --- a/test/OpenMP/target_teams_distribute_map_messages.cpp +++ b/test/OpenMP/target_teams_distribute_map_messages.cpp @@ -86,6 +86,8 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute map(l[:-1]) // expected-error 2 {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target teams distribute map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute map(tofrom: t[:I]) @@ -206,6 +208,8 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute map(l[:-1]) // expected-error {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target teams distribute map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute map(to: x) diff --git a/test/OpenMP/target_teams_distribute_parallel_for_collapse_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_collapse_messages.cpp index 61e76cde02..a866b79764 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_collapse_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_collapse_messages.cpp @@ -56,7 +56,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used}} #endif // expected-error@+3 2 {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'collapse' clause}} -// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+1 2 {{expression is not an integral constant expression}} #pragma omp target teams distribute parallel for collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = ST; i < N; i++) @@ -121,7 +121,7 @@ int main(int argc, char **argv) { #endif // expected-error@+3 {{expression is not an integral constant expression}} // expected-error@+2 2 {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'collapse' clause}} -// expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target teams distribute parallel for collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp index 878fac1517..f47655d686 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_map_messages.cpp @@ -86,6 +86,8 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for map(l[:-1]) // expected-error 2 {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target teams distribute parallel for map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for map(tofrom: t[:I]) @@ -206,6 +208,8 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for map(l[:-1]) // expected-error {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target teams distribute parallel for map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for map(to: x) diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_collapse_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_collapse_messages.cpp index 069ea65ad2..4ca7a8ca9a 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_collapse_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_collapse_messages.cpp @@ -56,7 +56,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used}} #endif // expected-error@+3 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'collapse' clause}} -// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+1 2 {{expression is not an integral constant expression}} #pragma omp target teams distribute parallel for simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = ST; i < N; i++) @@ -121,7 +121,7 @@ int main(int argc, char **argv) { #endif // expected-error@+3 {{expression is not an integral constant expression}} // expected-error@+2 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'collapse' clause}} -// expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target teams distribute parallel for simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp index b2da680885..64fe5f6e09 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_map_messages.cpp @@ -86,6 +86,8 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd map(l[:-1]) // expected-error 2 {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target teams distribute parallel for simd map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd map(tofrom: t[:I]) @@ -206,6 +208,8 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd map(l[:-1]) // expected-error {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target teams distribute parallel for simd map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute parallel for simd map(to: x) diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_safelen_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_safelen_messages.cpp index f068e6b2e4..d05f071e91 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_safelen_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_safelen_messages.cpp @@ -49,9 +49,12 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif -#pragma omp target teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp target teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -108,9 +111,12 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+5 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif -#pragma omp target teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp target teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/target_teams_distribute_parallel_for_simd_simdlen_messages.cpp b/test/OpenMP/target_teams_distribute_parallel_for_simd_simdlen_messages.cpp index d5f714c9c3..1c490582fd 100644 --- a/test/OpenMP/target_teams_distribute_parallel_for_simd_simdlen_messages.cpp +++ b/test/OpenMP/target_teams_distribute_parallel_for_simd_simdlen_messages.cpp @@ -49,9 +49,12 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif -#pragma omp target teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp target teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -108,9 +111,12 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+5 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif -#pragma omp target teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp target teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/target_teams_distribute_simd_collapse_messages.cpp b/test/OpenMP/target_teams_distribute_simd_collapse_messages.cpp index a2d3bde44a..6561091ec8 100644 --- a/test/OpenMP/target_teams_distribute_simd_collapse_messages.cpp +++ b/test/OpenMP/target_teams_distribute_simd_collapse_messages.cpp @@ -53,7 +53,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp target teams distribute simd', but found only 1}} // expected-error@+6 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'collapse' clause}} -// expected-error@+5 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -118,7 +118,7 @@ int main(int argc, char **argv) { // expected-error@+6 {{expression is not an integral constant expression}} // expected-error@+5 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'collapse' clause}} -// expected-error@+4 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+4 {{argument to 'collapse' clause must be a strictly positive integer value}} #if __cplusplus >= 201103L // expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif diff --git a/test/OpenMP/target_teams_distribute_simd_map_messages.cpp b/test/OpenMP/target_teams_distribute_simd_map_messages.cpp index c559bcb410..3806c4ecf5 100644 --- a/test/OpenMP/target_teams_distribute_simd_map_messages.cpp +++ b/test/OpenMP/target_teams_distribute_simd_map_messages.cpp @@ -86,6 +86,8 @@ T tmain(T argc) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd map(l[:-1]) // expected-error 2 {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target teams distribute simd map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd map(tofrom: t[:I]) @@ -206,6 +208,8 @@ int main(int argc, char **argv) { for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd map(l[:-1]) // expected-error {{section length is evaluated to a negative value -1}} for (i = 0; i < argc; ++i) foo(); +#pragma omp target teams distribute simd map(l[true:true]) + for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd map(x) for (i = 0; i < argc; ++i) foo(); #pragma omp target teams distribute simd map(to: x) diff --git a/test/OpenMP/target_teams_distribute_simd_safelen_messages.cpp b/test/OpenMP/target_teams_distribute_simd_safelen_messages.cpp index 67b22216b9..da5c8eb75d 100644 --- a/test/OpenMP/target_teams_distribute_simd_safelen_messages.cpp +++ b/test/OpenMP/target_teams_distribute_simd_safelen_messages.cpp @@ -49,9 +49,12 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif -#pragma omp target teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp target teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -108,9 +111,12 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+5 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif -#pragma omp target teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp target teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/target_teams_distribute_simd_simdlen_messages.cpp b/test/OpenMP/target_teams_distribute_simd_simdlen_messages.cpp index 6fea25a57a..851fff36f2 100644 --- a/test/OpenMP/target_teams_distribute_simd_simdlen_messages.cpp +++ b/test/OpenMP/target_teams_distribute_simd_simdlen_messages.cpp @@ -49,9 +49,12 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif -#pragma omp target teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp target teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -108,9 +111,12 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+5 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif -#pragma omp target teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp target teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/target_teams_map_messages.cpp b/test/OpenMP/target_teams_map_messages.cpp index e59a96c881..8608756bd4 100644 --- a/test/OpenMP/target_teams_map_messages.cpp +++ b/test/OpenMP/target_teams_map_messages.cpp @@ -57,6 +57,8 @@ struct SA { {} #pragma omp target teams map(b[:-1]) // expected-error {{section length is evaluated to a negative value -1}} {} + #pragma omp target teams map(b[true:true]) + {} #pragma omp target teams map(always, tofrom: c,f) {} diff --git a/test/OpenMP/taskloop_collapse_messages.cpp b/test/OpenMP/taskloop_collapse_messages.cpp index 4de0f38dae..091b8b8321 100644 --- a/test/OpenMP/taskloop_collapse_messages.cpp +++ b/test/OpenMP/taskloop_collapse_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp taskloop collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp taskloop', but found only 1}} // expected-error@+6 2 {{directive '#pragma omp taskloop' cannot contain more than one 'collapse' clause}} - // expected-error@+5 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -86,7 +86,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp taskloop' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp taskloop collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp taskloop collapse (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/taskloop_simd_collapse_messages.cpp b/test/OpenMP/taskloop_simd_collapse_messages.cpp index 3f7e66a277..fd620c8fc1 100644 --- a/test/OpenMP/taskloop_simd_collapse_messages.cpp +++ b/test/OpenMP/taskloop_simd_collapse_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp taskloop simd collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp taskloop simd', but found only 1}} // expected-error@+6 2 {{directive '#pragma omp taskloop simd' cannot contain more than one 'collapse' clause}} - // expected-error@+5 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -86,7 +86,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp taskloop simd' cannot contain more than one 'collapse' clause}} - // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp taskloop simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp taskloop simd collapse (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/taskloop_simd_safelen_messages.cpp b/test/OpenMP/taskloop_simd_safelen_messages.cpp index 87c4fe07ab..b926689c3b 100644 --- a/test/OpenMP/taskloop_simd_safelen_messages.cpp +++ b/test/OpenMP/taskloop_simd_safelen_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp taskloop simd safelen ((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp taskloop simd' cannot contain more than one 'safelen' clause}} - // expected-error@+5 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'safelen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -84,7 +84,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp taskloop simd' cannot contain more than one 'safelen' clause}} - // expected-error@+1 2 {{argument to 'safelen' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}} #pragma omp taskloop simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp taskloop simd safelen (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/taskloop_simd_simdlen_messages.cpp b/test/OpenMP/taskloop_simd_simdlen_messages.cpp index 4170d012dd..75d9a1d360 100644 --- a/test/OpenMP/taskloop_simd_simdlen_messages.cpp +++ b/test/OpenMP/taskloop_simd_simdlen_messages.cpp @@ -39,7 +39,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} #pragma omp taskloop simd simdlen ((ST > 0) ? 1 + ST : 2) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error@+6 2 {{directive '#pragma omp taskloop simd' cannot contain more than one 'simdlen' clause}} - // expected-error@+5 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} + // expected-error@+5 {{argument to 'simdlen' clause must be a strictly positive integer value}} // expected-error@+4 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -84,7 +84,7 @@ int main(int argc, char **argv) { // expected-note@+4 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif // expected-error@+2 2 {{directive '#pragma omp taskloop simd' cannot contain more than one 'simdlen' clause}} - // expected-error@+1 2 {{argument to 'simdlen' clause must be a strictly positive integer value}} + // expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}} #pragma omp taskloop simd simdlen (foobool(argc)), simdlen (true), simdlen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp taskloop simd simdlen (S1) // expected-error {{'S1' does not refer to a value}} diff --git a/test/OpenMP/teams_distribute_collapse_messages.cpp b/test/OpenMP/teams_distribute_collapse_messages.cpp index bcbd774e8e..d95109c3dc 100644 --- a/test/OpenMP/teams_distribute_collapse_messages.cpp +++ b/test/OpenMP/teams_distribute_collapse_messages.cpp @@ -63,7 +63,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} // expected-note@+6 2 {{non-constexpr function 'foobool' cannot be used}} #endif // expected-error@+4 2 {{directive '#pragma omp teams distribute' cannot contain more than one 'collapse' clause}} -// expected-error@+3 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+3 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+2 2 {{expression is not an integral constant expression}} #pragma omp target #pragma omp teams distribute collapse (foobool(argc)), collapse (true), collapse (-5) @@ -140,7 +140,7 @@ int main(int argc, char **argv) { #endif // expected-error@+4 {{expression is not an integral constant expression}} // expected-error@+3 2 {{directive '#pragma omp teams distribute' cannot contain more than one 'collapse' clause}} -// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target #pragma omp teams distribute collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) diff --git a/test/OpenMP/teams_distribute_parallel_for_collapse_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_collapse_messages.cpp index 2e83a37bc9..1171807fdb 100644 --- a/test/OpenMP/teams_distribute_parallel_for_collapse_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_collapse_messages.cpp @@ -63,7 +63,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} // expected-note@+6 2 {{non-constexpr function 'foobool' cannot be used}} #endif // expected-error@+4 2 {{directive '#pragma omp teams distribute parallel for' cannot contain more than one 'collapse' clause}} -// expected-error@+3 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+3 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+2 2 {{expression is not an integral constant expression}} #pragma omp target #pragma omp teams distribute parallel for collapse (foobool(argc)), collapse (true), collapse (-5) @@ -139,7 +139,7 @@ int main(int argc, char **argv) { #endif // expected-error@+4 {{expression is not an integral constant expression}} // expected-error@+3 2 {{directive '#pragma omp teams distribute parallel for' cannot contain more than one 'collapse' clause}} -// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target #pragma omp teams distribute parallel for collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) diff --git a/test/OpenMP/teams_distribute_parallel_for_simd_collapse_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_simd_collapse_messages.cpp index a287da7a36..31611c7ff0 100644 --- a/test/OpenMP/teams_distribute_parallel_for_simd_collapse_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_simd_collapse_messages.cpp @@ -63,7 +63,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} // expected-note@+6 2 {{non-constexpr function 'foobool' cannot be used}} #endif // expected-error@+4 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'collapse' clause}} -// expected-error@+3 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+3 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+2 2 {{expression is not an integral constant expression}} #pragma omp target #pragma omp teams distribute parallel for simd collapse (foobool(argc)), collapse (true), collapse (-5) @@ -139,7 +139,7 @@ int main(int argc, char **argv) { #endif // expected-error@+4 {{expression is not an integral constant expression}} // expected-error@+3 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'collapse' clause}} -// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+2 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target #pragma omp teams distribute parallel for simd collapse (foobool(argc)), collapse (true), collapse (-5) for (int i = 4; i < 12; i++) diff --git a/test/OpenMP/teams_distribute_parallel_for_simd_safelen_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_simd_safelen_messages.cpp index e673bb382a..2b31c89634 100644 --- a/test/OpenMP/teams_distribute_parallel_for_simd_safelen_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_simd_safelen_messages.cpp @@ -56,10 +56,13 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+3 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+6 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target -#pragma omp teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -126,10 +129,13 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+3 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+6 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target -#pragma omp teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/teams_distribute_parallel_for_simd_simdlen_messages.cpp b/test/OpenMP/teams_distribute_parallel_for_simd_simdlen_messages.cpp index e673bb382a..2b31c89634 100644 --- a/test/OpenMP/teams_distribute_parallel_for_simd_simdlen_messages.cpp +++ b/test/OpenMP/teams_distribute_parallel_for_simd_simdlen_messages.cpp @@ -56,10 +56,13 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+3 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+6 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target -#pragma omp teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -126,10 +129,13 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+3 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+6 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target -#pragma omp teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp teams distribute parallel for simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/teams_distribute_simd_collapse_messages.cpp b/test/OpenMP/teams_distribute_simd_collapse_messages.cpp index d0b2f814bf..a5eb6d20e0 100644 --- a/test/OpenMP/teams_distribute_simd_collapse_messages.cpp +++ b/test/OpenMP/teams_distribute_simd_collapse_messages.cpp @@ -60,7 +60,7 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp teams distribute simd', but found only 1}} // expected-error@+7 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'collapse' clause}} -// expected-error@+6 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+6 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+5 2 {{expression is not an integral constant expression}} #if __cplusplus >= 201103L // expected-note@+3 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} @@ -136,7 +136,7 @@ int main(int argc, char **argv) { // expected-error@+7 {{expression is not an integral constant expression}} // expected-error@+6 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'collapse' clause}} -// expected-error@+5 2 {{argument to 'collapse' clause must be a strictly positive integer value}} +// expected-error@+5 {{argument to 'collapse' clause must be a strictly positive integer value}} #if __cplusplus >= 201103L // expected-note@+3 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif diff --git a/test/OpenMP/teams_distribute_simd_safelen_messages.cpp b/test/OpenMP/teams_distribute_simd_safelen_messages.cpp index 7be581a96b..a3ea61e1da 100644 --- a/test/OpenMP/teams_distribute_simd_safelen_messages.cpp +++ b/test/OpenMP/teams_distribute_simd_safelen_messages.cpp @@ -56,10 +56,13 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+3 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+6 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target -#pragma omp teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -126,10 +129,13 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+3 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+6 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target -#pragma omp teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/OpenMP/teams_distribute_simd_simdlen_messages.cpp b/test/OpenMP/teams_distribute_simd_simdlen_messages.cpp index 7be581a96b..a3ea61e1da 100644 --- a/test/OpenMP/teams_distribute_simd_simdlen_messages.cpp +++ b/test/OpenMP/teams_distribute_simd_simdlen_messages.cpp @@ -56,10 +56,13 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}} argv[0][i] = argv[0][i] - argv[0][i-ST]; #if __cplusplus >= 201103L - // expected-note@+3 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+6 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target -#pragma omp teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'safelen' clause}} expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{expression is not an integral constant expression}} +// expected-error@+3 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'safelen' clause}} +// expected-error@+2 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+1 2 {{expression is not an integral constant expression}} +#pragma omp teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; @@ -126,10 +129,13 @@ int main(int argc, char **argv) { argv[0][i] = argv[0][i] - argv[0][i-4]; #if __cplusplus >= 201103L - // expected-note@+3 {{non-constexpr function 'foobool' cannot be used in a constant expression}} + // expected-note@+6 {{non-constexpr function 'foobool' cannot be used in a constant expression}} #endif #pragma omp target -#pragma omp teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) // expected-error 2 {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'safelen' clause}} expected-error {{expression is not an integral constant expression}} +// expected-error@+3 {{argument to 'safelen' clause must be a strictly positive integer value}} +// expected-error@+2 2 {{directive '#pragma omp teams distribute simd' cannot contain more than one 'safelen' clause}} +// expected-error@+1 {{expression is not an integral constant expression}} +#pragma omp teams distribute simd safelen (foobool(argc)), safelen (true), safelen (-5) for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; diff --git a/test/Sema/shift.c b/test/Sema/shift.c index 47744fb049..63c9538249 100644 --- a/test/Sema/shift.c +++ b/test/Sema/shift.c @@ -20,6 +20,9 @@ void test() { c = 1 >> -0; c = 1 << -1; // expected-warning {{shift count is negative}} c = 1 >> -1; // expected-warning {{shift count is negative}} + c = 1 << (unsigned)-1; // expected-warning {{shift count >= width of type}} + // expected-warning@-1 {{implicit conversion}} + c = 1 >> (unsigned)-1; // expected-warning {{shift count >= width of type}} c = 1 << c; c <<= 0; c >>= 0; diff --git a/test/SemaCXX/constexpr-unsigned-high-bit.cpp b/test/SemaCXX/constexpr-unsigned-high-bit.cpp new file mode 100644 index 0000000000..19d8dcab66 --- /dev/null +++ b/test/SemaCXX/constexpr-unsigned-high-bit.cpp @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -std=c++14 -fsyntax-only %s + +#include + +constexpr unsigned inc() { + unsigned i = INT_MAX; + ++i; // should not warn value is outside range + return i; +} + +constexpr unsigned dec() { + unsigned i = INT_MIN; + --i; // should not warn value is outside range + return i; +}