xref: /llvm-project/clang/test/CodeGenCXX/vtable-holder-self-reference.cpp (revision 3459ce2e5ebbabb8d4dde3809da50dc89e1b0b35)
1*3459ce2eSDouglas Katzman // RUN: %clang_cc1 -emit-llvm -dwarf-version=2 -debug-info-kind=limited -x c++ -o - %s | FileCheck %s
2c8ee63e2SDuncan P. N. Exon Smith //
3c8ee63e2SDuncan P. N. Exon Smith // PR21941: crasher for self-referencing DW_TAG_structure_type node.  If we get
4c8ee63e2SDuncan P. N. Exon Smith // rid of self-referenceing structure_types (PR21902), then it should be safe
5c8ee63e2SDuncan P. N. Exon Smith // to just kill this test.
6c8ee63e2SDuncan P. N. Exon Smith //
79dd4e4e6SDuncan P. N. Exon Smith // CHECK: ![[SELF:[0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "B",
8f04be1fbSDuncan P. N. Exon Smith // CHECK-SAME:                                         vtableHolder: ![[SELF]]
9c8ee63e2SDuncan P. N. Exon Smith 
foo()10c8ee63e2SDuncan P. N. Exon Smith void foo() {
11c8ee63e2SDuncan P. N. Exon Smith   struct V {
12c8ee63e2SDuncan P. N. Exon Smith     int vi;
13c8ee63e2SDuncan P. N. Exon Smith   };
14c8ee63e2SDuncan P. N. Exon Smith   struct B : virtual V {};
15c8ee63e2SDuncan P. N. Exon Smith   B b;
16c8ee63e2SDuncan P. N. Exon Smith }
17