[clang] [CIR] Add decl case for template specialization (PR #143029)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 5 13:45:44 PDT 2025
================
@@ -0,0 +1,88 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-cir %s -o %t.cir
+// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-llvm %s -o %t-cir.ll
+// RUN: FileCheck --input-file=%t-cir.ll %s -check-prefix=LLVM
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -emit-llvm %s -o %t.ll
+// RUN: FileCheck --input-file=%t.ll %s -check-prefix=OGCG
+
+template<class T>
+class X {
+public:
+ int f() { return 0; }
+};
+
+template<> class X<int> {
+public:
+ int f() { return 1; }
+};
+
+// TODO: This will get dropped when we are deferring functions
+// The speecialization is instantiated first
----------------
erichkeane wrote:
```suggestion
// The specialization is instantiated first
```
https://github.com/llvm/llvm-project/pull/143029
More information about the cfe-commits
mailing list