summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/target_simd_if_messages.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-12-10 12:44:45 -0500
committerAlexey Bataev <a.bataev@hotmail.com>2019-12-10 15:33:18 -0500
commitef94cd1cf81d6e66838e1d7395fdaa6795ec7165 (patch)
tree77b6fd7f1af29e38c4d08903d9539fa060a13a3e /clang/test/OpenMP/target_simd_if_messages.cpp
parentc9e0b354e2749ce7ab553974692cb35c8651a869 (diff)
downloadbcm5719-llvm-ef94cd1cf81d6e66838e1d7395fdaa6795ec7165.tar.gz
bcm5719-llvm-ef94cd1cf81d6e66838e1d7395fdaa6795ec7165.zip
[OPENMP50]Add if clause in target simd directive.
According to OpenMP 5.0, if clause can be used in for simd directive. If condition in the if clause if false, the non-vectorized version of the loop must be executed.
Diffstat (limited to 'clang/test/OpenMP/target_simd_if_messages.cpp')
-rw-r--r--clang/test/OpenMP/target_simd_if_messages.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/clang/test/OpenMP/target_simd_if_messages.cpp b/clang/test/OpenMP/target_simd_if_messages.cpp
index 5f3e9e3910a..6d63ae14b16 100644
--- a/clang/test/OpenMP/target_simd_if_messages.cpp
+++ b/clang/test/OpenMP/target_simd_if_messages.cpp
@@ -1,6 +1,8 @@
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp -fopenmp-version=45 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp -fopenmp-version=50 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-simd -fopenmp-version=45 %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-simd -fopenmp-version=50 %s -Wuninitialized
void foo() {
}
@@ -50,11 +52,11 @@ int tmain(T argc, S **argv) {
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd if(target : argc)
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd if(target : argc) if (simd:argc) // expected-error {{directive name modifier 'simd' is not allowed for '#pragma omp target simd'}}
+ #pragma omp target simd if(target : argc) if (simd:argc) // omp45-error {{directive name modifier 'simd' is not allowed for '#pragma omp target simd'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd if(target : argc) if (target :argc) // expected-error {{directive '#pragma omp target simd' cannot contain more than one 'if' clause with 'target' name modifier}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd if(target : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{no more 'if' clause is allowed}}
+ #pragma omp target simd if(target : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} omp45-error {{no more 'if' clause is allowed}} omp50-error {{expected 'simd' directive name modifier}}
for (i = 0; i < argc; ++i) foo();
return 0;
@@ -90,11 +92,11 @@ int main(int argc, char **argv) {
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd if(target : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd if(target : argc + z) if (simd:argc) // expected-error {{directive name modifier 'simd' is not allowed for '#pragma omp target simd'}}
+ #pragma omp target simd if(target : argc + z) if (simd:argc) // omp45-error {{directive name modifier 'simd' is not allowed for '#pragma omp target simd'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd if(target : argc) if (target :argc) // expected-error {{directive '#pragma omp target simd' cannot contain more than one 'if' clause with 'target' name modifier}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd if(target : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{no more 'if' clause is allowed}}
+ #pragma omp target simd if(target : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} omp45-error {{no more 'if' clause is allowed}} omp50-error {{expected 'simd' directive name modifier}}
for (i = 0; i < argc; ++i) foo();
return tmain(argc, argv);
OpenPOWER on IntegriCloud