1 // RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-darwin10 -o - %s | FileCheck %s
2 template<typename T>
3 struct X {
4 static T member1;
5 static T member2;
6 static T member3;
7 };
8
9 template<typename T>
10 T X<T>::member1;
11
12 template<typename T>
13 T X<T>::member2 = 17;
14
15 // CHECK: @_ZN1XIiE7member1E = weak_odr global i32 0
16 template int X<int>::member1;
17
18 // CHECK: @_ZN1XIiE7member2E = weak_odr global i32 17
19 template int X<int>::member2;
20
21 // For implicit instantiation of
get(bool Cond1,bool Cond2)22 long& get(bool Cond1, bool Cond2) {
23 // CHECK: @_ZN1XIlE7member1E = linkonce_odr global i64 0
24 // CHECK: @_ZN1XIlE7member2E = linkonce_odr global i64 17
25 // CHECK: @_ZN1XIlE7member3E = external global i64
26 return Cond1? X<long>::member1
27 : Cond2? X<long>::member2
28 : X<long>::member3;
29 }
30