wenlei updated this revision to Diff 414251.
wenlei added a comment.
Herald added projects: clang, All.
Herald added a subscriber: cfe-commits.

Add test case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120610/new/

https://reviews.llvm.org/D120610

Files:
  clang/test/CodeGen/split-debug-inlining-template.c
  llvm/lib/CodeGen/AsmPrinter/DIE.cpp


Index: llvm/lib/CodeGen/AsmPrinter/DIE.cpp
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/DIE.cpp
+++ llvm/lib/CodeGen/AsmPrinter/DIE.cpp
@@ -204,6 +204,7 @@
   const DIE *p = this;
   while (p) {
     if (p->getTag() == dwarf::DW_TAG_compile_unit ||
+        p->getTag() == dwarf::DW_TAG_skeleton_unit ||
         p->getTag() == dwarf::DW_TAG_type_unit)
       return p;
     p = p->getParent();
Index: clang/test/CodeGen/split-debug-inlining-template.c
===================================================================
--- /dev/null
+++ clang/test/CodeGen/split-debug-inlining-template.c
@@ -0,0 +1,16 @@
+// Check that we handle template types for split-dwarf-inlining without ICE.
+// RUN: %clang_cc1 -emit-obj -fdebug-info-for-profiling -fsplit-dwarf-inlining 
-debug-info-kind=constructor -dwarf-version=5 -split-dwarf-file %t.dwo -O2 -o 
%t.o -x c++ %s
+
+struct container {
+  int size();
+};
+
+template <typename T>
+int Range(T &x) {
+  return x.size();
+}
+
+int main() {
+  container v;
+  return Range<container>(v);
+}


Index: llvm/lib/CodeGen/AsmPrinter/DIE.cpp
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/DIE.cpp
+++ llvm/lib/CodeGen/AsmPrinter/DIE.cpp
@@ -204,6 +204,7 @@
   const DIE *p = this;
   while (p) {
     if (p->getTag() == dwarf::DW_TAG_compile_unit ||
+        p->getTag() == dwarf::DW_TAG_skeleton_unit ||
         p->getTag() == dwarf::DW_TAG_type_unit)
       return p;
     p = p->getParent();
Index: clang/test/CodeGen/split-debug-inlining-template.c
===================================================================
--- /dev/null
+++ clang/test/CodeGen/split-debug-inlining-template.c
@@ -0,0 +1,16 @@
+// Check that we handle template types for split-dwarf-inlining without ICE.
+// RUN: %clang_cc1 -emit-obj -fdebug-info-for-profiling -fsplit-dwarf-inlining -debug-info-kind=constructor -dwarf-version=5 -split-dwarf-file %t.dwo -O2 -o %t.o -x c++ %s
+
+struct container {
+  int size();
+};
+
+template <typename T>
+int Range(T &x) {
+  return x.size();
+}
+
+int main() {
+  container v;
+  return Range<container>(v);
+}
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to