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/vla.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'test/CodeGenCXX/vla.cpp') diff --git a/test/CodeGenCXX/vla.cpp b/test/CodeGenCXX/vla.cpp index 58cdf795ee5a..b523c769d541 100644 --- a/test/CodeGenCXX/vla.cpp +++ b/test/CodeGenCXX/vla.cpp @@ -1,5 +1,19 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - | FileCheck %s +template +struct S { + static int n; +}; +template int S::n = 5; + +int f() { + // Make sure that the reference here is enough to trigger the instantiation of + // the static data member. + // CHECK: @_ZN1SIiE1nE = weak_odr global i32 5 + int a[S::n]; + return sizeof a; +} + // rdar://problem/9506377 void test0(void *array, int n) { // CHECK: define void @_Z5test0Pvi( @@ -40,4 +54,3 @@ void test0(void *array, int n) { // CHECK-NEXT: ret void } - -- cgit v1.3