Clang Project

clang_source_code/test/CodeGenCXX/Inputs/debug-info-class-limited.cpp
1
2// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "PR16214",{{.*}} line: [[@LINE+2]],{{.*}}
3// CHECK-NOT: DIFlagFwdDecl
4struct 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: DIFlagFwdDecl
16struct 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: DIFlagFwdDecl
27struct 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 only
38// required because of the 'bar' type which is not required at all (or might
39// only be required to be declared)
40// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "foo",{{.*}} line: [[@LINE+2]],{{.*}}
41// CHECK-NOT: DIFlagFwdDecl
42struct foo {
43};
44
45struct bar {
46  foo f;
47};
48
49void func() {
50  foo *f;
51}
52}
53