Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / temp / temp.spec / temp.explicit / p1-emit.cpp
blob24f68a094e542efd706dced2fbba05a6318bdbcc
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 };
9 template<typename T>
10 T X<T>::member1;
12 template<typename T>
13 T X<T>::member2 = 17;
15 // CHECK: @_ZN1XIiE7member1E = weak_odr global i32 0
16 template int X<int>::member1;
18 // CHECK: @_ZN1XIiE7member2E = weak_odr global i32 17
19 template int X<int>::member2;
21 // For implicit instantiation of
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;