diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
| commit | dbe13110f59f48b4dbb7552b3ac2935acdeece7f (patch) | |
| tree | be1815eb79b42ff482a8562b13c2dcbf0c5dcbee /test/CodeGenCXX/vla.cpp | |
| parent | 9da628931ebf2609493570f87824ca22402cc65f (diff) | |
Notes
Diffstat (limited to 'test/CodeGenCXX/vla.cpp')
| -rw-r--r-- | test/CodeGenCXX/vla.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
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<typename T> +struct S { + static int n; +}; +template<typename T> int S<T>::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<int>::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 } - |
