55// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -emit-llvm %s -o %t.ll
66// RUN: FileCheck --input-file=%t.ll %s -check-prefix=OGCG
77
8+ template <typename T, typename U>
9+ class Templ {};
10+
11+ template <typename T>
12+ class Templ <T, int >{};
13+
14+ Templ<int , int > t;
15+
16+ // CIR: !rec_Templ3Cint2C_int3E = !cir.record<class "Templ<int, int>" padded {!u8i}>
17+ // CIR: cir.global external @t = #cir.zero : !rec_Templ3Cint2C_int3E
18+
19+ // LLVM: %"class.Templ<int, int>" = type { i8 }
20+ // LLVM: @t = global %"class.Templ<int, int>" zeroinitializer
21+
22+ // OGCG: %class.Templ = type { i8 }
23+ // OGCG: @t = global %class.Templ zeroinitializer
24+
825template <class T >
926class X {
1027public:
@@ -16,14 +33,6 @@ template<> class X<int> {
1633 int f () { return 1 ; }
1734};
1835
19- // TODO: This will get dropped when we are deferring functions
20- // The speecialization is instantiated first
21- // CIR: cir.func{{.*}} @_ZN1XIiE1fEv
22- // CIR: cir.const #cir.int<1>
23-
24- // LLVM: define{{.*}} i32 @_ZN1XIiE1fEv
25- // LLVM: store i32 1
26-
2736void test_double () {
2837 X<double > d;
2938 d.f ();
@@ -52,9 +61,15 @@ void test_int() {
5261 n.f ();
5362}
5463
64+ // CIR: cir.func{{.*}} @_ZN1XIiE1fEv
65+ // CIR: cir.const #cir.int<1>
66+ //
5567// CIR: cir.func{{.*}} @_Z8test_intv()
5668// CIR: cir.call @_ZN1XIiE1fEv
5769
70+ // LLVM: define{{.*}} i32 @_ZN1XIiE1fEv
71+ // LLVM: store i32 1
72+ //
5873// LLVM: define{{.*}} void @_Z8test_intv()
5974// LLVM: call i32 @_ZN1XIiE1fEv
6075
0 commit comments