summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/target_vla_messages.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-07-11 20:35:31 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2019-07-11 20:35:31 +0000
commit8526031c5b984f3389089654cc410f314d533fd7 (patch)
tree8b3a2563925b729c6494092dc40126c4255bf3ec /clang/test/OpenMP/target_vla_messages.cpp
parentf002fcb2ad64a75a2f0aea3eb067614f4681284b (diff)
downloadbcm5719-llvm-8526031c5b984f3389089654cc410f314d533fd7.tar.gz
bcm5719-llvm-8526031c5b984f3389089654cc410f314d533fd7.zip
[OPENMP]Improve handling of analysis of unsupported VLAs in reductions.
Fixed the processing of the unsupported VLAs in the reduction clauses. Used targetDiag if the diagnostics can be delayed and emit it immediately if the target does not support VLAs and we're parsing target directive with the reduction clauses. llvm-svn: 365821
Diffstat (limited to 'clang/test/OpenMP/target_vla_messages.cpp')
-rw-r--r--clang/test/OpenMP/target_vla_messages.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/OpenMP/target_vla_messages.cpp b/clang/test/OpenMP/target_vla_messages.cpp
index 30a27517242..cf6a024c6ba 100644
--- a/clang/test/OpenMP/target_vla_messages.cpp
+++ b/clang/test/OpenMP/target_vla_messages.cpp
@@ -206,4 +206,10 @@ void for_reduction(int arg) {
#pragma omp parallel
#pragma omp for reduction(+: vla[0:arg])
for (int i = 0; i < arg; i++) ;
+#ifdef NO_VLA
+ // expected-error@+3 {{cannot generate code for reduction on array section, which requires a variable length array}}
+ // expected-note@+2 {{variable length arrays are not supported for the current target}}
+#endif
+#pragma omp target reduction(+ : vla[0:arg])
+ for (int i = 0; i < arg; i++) ;
}
OpenPOWER on IntegriCloud