]> granicus.if.org Git - clang/commitdiff
Add a testcase that exercises DIBuilder's handling of cyclic debug info nodes.
authorAdrian Prantl <aprantl@apple.com>
Tue, 17 Feb 2015 19:17:56 +0000 (19:17 +0000)
committerAdrian Prantl <aprantl@apple.com>
Tue, 17 Feb 2015 19:17:56 +0000 (19:17 +0000)
rdar://problem/19839612

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229522 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGenObjCXX/debug-info-cyclic.mm [new file with mode: 0644]

diff --git a/test/CodeGenObjCXX/debug-info-cyclic.mm b/test/CodeGenObjCXX/debug-info-cyclic.mm
new file mode 100644 (file)
index 0000000..8fd83a5
--- /dev/null
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -g -emit-llvm %s -o - | FileCheck %s
+
+// CHECK: ![[B:.*]] = {{.*}}, null, null, ![[BMEMBERS:.*]], null, null, null} ; [ DW_TAG_structure_type ] [B] [line [[@LINE+1]], size 8, align 8, offset 0] [def] [from ]
+struct B {
+  B(struct A *);
+// CHECK: ![[BMEMBERS]] = !{![[BB:.*]]}
+// CHECK: ![[BB]] = {{.*}} ![[B]], ![[TY:[0-9]+]], {{.*}}} ; [ DW_TAG_subprogram ] [line [[@LINE-2]]] [B]
+// CHECK: ![[TY]] = {{.*}} ![[ARGS:[0-9]+]], null, null, null} ; [ DW_TAG_subroutine_type ]
+// CHECK: ![[ARGS]] = !{null, ![[THIS:[0-9]+]],
+// CHECK: ![[THIS]] = {{.*}}[[B]]} ; [ DW_TAG_pointer_type ] [
+};
+
+struct C {
+ B b;
+ C(struct A *);
+ virtual ~C();
+};
+
+C::C(struct A *a)
+  : b(a) {
+}