blob: 34a1cfa00e2ce7520ad8ebea6b68608ae0ff64aa [file] [log] [blame]
David Blaikie940ca4d2013-06-21 21:03:11 +00001
David Blaikie3612e4f2016-05-29 19:50:23 +00002// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "PR16214",{{.*}} line: [[@LINE+2]],{{.*}}
3// CHECK-NOT: DIFlagFwdDecl
David Blaikie204f2e52014-07-16 23:25:44 +00004struct PR16214 {
David Blaikie940ca4d2013-06-21 21:03:11 +00005 int i;
6};
7
David Blaikie204f2e52014-07-16 23:25:44 +00008typedef PR16214 bar;
David Blaikie940ca4d2013-06-21 21:03:11 +00009
David Blaikiebea8cc72013-06-21 21:23:18 +000010bar *a;
11bar b;
David Blaikiebea8cc72013-06-21 21:23:18 +000012
David Blaikie48ad6dc2013-07-13 21:08:14 +000013namespace PR14467 {
David Blaikie3612e4f2016-05-29 19:50:23 +000014// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "foo",{{.*}} line: [[@LINE+2]],{{.*}}
15// CHECK-NOT: DIFlagFwdDecl
David Blaikiebea8cc72013-06-21 21:23:18 +000016struct foo {
David Blaikiebea8cc72013-06-21 21:23:18 +000017};
18
David Blaikie4686b162013-06-21 21:58:54 +000019foo *bar(foo *a) {
David Blaikiebea8cc72013-06-21 21:23:18 +000020 foo *b = new foo(*a);
21 return b;
22}
23}
24
David Blaikie48ad6dc2013-07-13 21:08:14 +000025namespace test1 {
David Blaikie3612e4f2016-05-29 19:50:23 +000026// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "foo",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagFwdDecl
David Blaikiebea8cc72013-06-21 21:23:18 +000027struct foo {
David Blaikiebea8cc72013-06-21 21:23:18 +000028};
29
30extern int bar(foo *a);
31int baz(foo *a) {
32 return bar(a);
33}
David Blaikie940ca4d2013-06-21 21:03:11 +000034}
David Blaikie48ad6dc2013-07-13 21:08:14 +000035
36namespace test2 {
37// FIXME: if we were a bit fancier, we could realize that the 'foo' type is only
38// required because of the 'bar' type which is not required at all (or might
39// only be required to be declared)
David Blaikie3612e4f2016-05-29 19:50:23 +000040// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "foo",{{.*}} line: [[@LINE+2]],{{.*}}
41// CHECK-NOT: DIFlagFwdDecl
David Blaikie48ad6dc2013-07-13 21:08:14 +000042struct foo {
43};
44
45struct bar {
46 foo f;
47};
48
49void func() {
50 foo *f;
51}
52}