From 2f5ed342797d78e1544338de09186c54d027144e Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Thu, 13 Oct 2016 09:52:46 +0000 Subject: 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 --- clang/test/OpenMP/debug-info-openmp-array.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 clang/test/OpenMP/debug-info-openmp-array.cpp (limited to 'clang/test/OpenMP/debug-info-openmp-array.cpp') 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 -- cgit v1.2.3