================
@@ -0,0 +1,161 @@
+; REQUIERES: system-linux
+; RUN: %llc_dwarf -mtriple=x86_64-linux -O0 -filetype=obj < %s \
+; RUN: | llvm-dwarfdump --show-children --name=foo - \
+; RUN: | FileCheck --implicit-check-not "{{DW_TAG|NULL}}" %s
+
+; The test ensures that AsmPrinter doesn't crashed compiling this.
+; It also demostrates misplacement for a local type (see PR55680 for details).
+
+; The test compiled from:
+
+; template<typename T>
+; struct A {
+; A(T &in) : a(in) {}
+; T a;
+; };
+;
+; __attribute__((always_inline))
+; void foo() {
+; struct B { int i; };
+; B objB;
+; A<B> objA(objB);
+; }
+;
+; int main() {
+; foo();
+; }
+
+; Concrete out-of-line tree of foo().
+; CHECK: DW_TAG_subprogram
+; CHECK: DW_AT_abstract_origin {{.*}} "_Z3foov"
+
+; FIXME: 'struct B' should be in the abstract tree below, not here.
+; CHECK: DW_TAG_structure_type
+; CHECK: DW_AT_name ("B")
+; CHECK: DW_TAG_member
+; CHECK: NULL
+;
+; CHECK: DW_TAG_variable
+; CHECK: DW_AT_abstract_origin {{.*}} "objB"
+; CHECK: DW_TAG_variable
+; CHECK: DW_AT_abstract_origin {{.*}} "objA"
+
+; CHECK: NULL
+
+; Abstract tree of foo().
+; CHECK: DW_TAG_subprogram
+; CHECK: DW_AT_name ("foo")
+; CHECK: DW_AT_inline (DW_INL_inlined)
+
+; CHECK: DW_TAG_variable
+; CHECK: DW_AT_name ("objB")
+; CHECK: DW_TAG_variable
+; CHECK: DW_AT_name ("objA")
+
+; CHECK: NULL
+
+; CHECK: DW_TAG_inlined_subroutine
+; CHECK: DW_AT_abstract_origin {{.*}} "_Z3foov"
+; CHECK: DW_TAG_variable
+; CHECK: DW_AT_abstract_origin {{.*}} "objB"
+; CHECK: DW_TAG_variable
+; CHECK: DW_AT_abstract_origin {{.*}} "objA"
+; CHECK: NULL
+
+%struct.B = type { i32 }
----------------
jmorse wrote:
I could be misreading, but shouldn't we have some type information for "A"
above, or otherwise something for the `objA` variable to refer to?
https://github.com/llvm/llvm-project/pull/165032
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits