brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 34a1cfa Raw
53 lines · cpp
1 2// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "PR16214",{{.*}} line: [[@LINE+2]],{{.*}}3// CHECK-NOT: DIFlagFwdDecl4struct PR16214 {5  int i;6};7 8typedef PR16214 bar;9 10bar *a;11bar b;12 13namespace PR14467 {14// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "foo",{{.*}} line: [[@LINE+2]],{{.*}}15// CHECK-NOT: DIFlagFwdDecl16struct foo {17};18 19foo *bar(foo *a) {20  foo *b = new foo(*a);21  return b;22}23}24 25namespace test1 {26// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "foo",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagFwdDecl27struct foo {28};29 30extern int bar(foo *a);31int baz(foo *a) {32  return bar(a);33}34}35 36namespace test2 {37// FIXME: if we were a bit fancier, we could realize that the 'foo' type is only38// required because of the 'bar' type which is not required at all (or might39// only be required to be declared)40// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "foo",{{.*}} line: [[@LINE+2]],{{.*}}41// CHECK-NOT: DIFlagFwdDecl42struct foo {43};44 45struct bar {46  foo f;47};48 49void func() {50  foo *f;51}52}53