1 | |
2 | // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "PR16214",{{.*}} line: [[@LINE+2]],{{.*}} |
3 | // CHECK-NOT: DIFlagFwdDecl |
4 | struct PR16214 { |
5 | int i; |
6 | }; |
7 | |
8 | typedef PR16214 bar; |
9 | |
10 | bar *a; |
11 | bar b; |
12 | |
13 | namespace PR14467 { |
14 | // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "foo",{{.*}} line: [[@LINE+2]],{{.*}} |
15 | // CHECK-NOT: DIFlagFwdDecl |
16 | struct foo { |
17 | }; |
18 | |
19 | foo *bar(foo *a) { |
20 | foo *b = new foo(*a); |
21 | return b; |
22 | } |
23 | } |
24 | |
25 | namespace test1 { |
26 | // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "foo",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagFwdDecl |
27 | struct foo { |
28 | }; |
29 | |
30 | extern int bar(foo *a); |
31 | int baz(foo *a) { |
32 | return bar(a); |
33 | } |
34 | } |
35 | |
36 | namespace 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 |
42 | struct foo { |
43 | }; |
44 | |
45 | struct bar { |
46 | foo f; |
47 | }; |
48 | |
49 | void func() { |
50 | foo *f; |
51 | } |
52 | } |
53 | |