summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/debug-info-openmp-array.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2016-10-13 09:52:46 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2016-10-13 09:52:46 +0000
commit2f5ed342797d78e1544338de09186c54d027144e (patch)
tree439ebbcb2644f9a7e74dffacd1282b73d9a3cd68 /clang/test/OpenMP/debug-info-openmp-array.cpp
parent9df3ac1f564b0b8367290edceba71a225b7f7f99 (diff)
downloadbcm5719-llvm-2f5ed342797d78e1544338de09186c54d027144e.tar.gz
bcm5719-llvm-2f5ed342797d78e1544338de09186c54d027144e.zip
Fix for PR30639: CGDebugInfo Null dereference with OpenMP array
access, by Erich Keane OpenMP creates a variable array type with a a null size-expr. The Debug generation failed to due to this. This patch corrects the openmp implementation, updates the tests, and adds a new one for this condition. Differential Revision: https://reviews.llvm.org/D25373 llvm-svn: 284110
Diffstat (limited to 'clang/test/OpenMP/debug-info-openmp-array.cpp')
-rw-r--r--clang/test/OpenMP/debug-info-openmp-array.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/OpenMP/debug-info-openmp-array.cpp b/clang/test/OpenMP/debug-info-openmp-array.cpp
new file mode 100644
index 00000000000..19bf2a284ad
--- /dev/null
+++ b/clang/test/OpenMP/debug-info-openmp-array.cpp
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -fopenmp -x c++ %s -verify -debug-info-kind=limited -emit-llvm -o - | FileCheck %s
+// expected-no-diagnostics
+
+void f(int m) {
+ int i;
+ int cen[m];
+#pragma omp parallel for
+ for (i = 0; i < m; ++i) {
+ cen[i] = i;
+ }
+}
+
+// CHECK: !DILocalVariable(name: "cen", arg: 6
OpenPOWER on IntegriCloud