From dbe13110f59f48b4dbb7552b3ac2935acdeece7f Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 14 Apr 2012 14:01:31 +0000 Subject: Vendor import of clang trunk r154661: http://llvm.org/svn/llvm-project/cfe/trunk@r154661 --- test/CodeGenCXX/c99-variable-length-array.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/CodeGenCXX/c99-variable-length-array.cpp') diff --git a/test/CodeGenCXX/c99-variable-length-array.cpp b/test/CodeGenCXX/c99-variable-length-array.cpp index 76f99c7b4137..d486f9b01826 100644 --- a/test/CodeGenCXX/c99-variable-length-array.cpp +++ b/test/CodeGenCXX/c99-variable-length-array.cpp @@ -25,3 +25,13 @@ void f(int argc, const char* argv[]) { // CHECK: call void @_ZN1XD1Ev // CHECK: ret void } + +namespace PR11744 { + // Make sure this doesn't crash; there was a use-after-free issue + // for this testcase. + template int f(int n) { + T arr[3][n]; + return 3; + } + int test = f(0); +} -- cgit v1.2.3