1 
2 // CHECK-DAG: [ DW_TAG_structure_type ] [PR16214] [line [[@LINE+1]], {{.*}} [def]
3 struct PR16214 {
4   int i;
5 };
6 
7 typedef PR16214 bar;
8 
9 bar *a;
10 bar b;
11 
12 namespace PR14467 {
13 // CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def]
14 struct foo {
15 };
16 
bar(foo * a)17 foo *bar(foo *a) {
18   foo *b = new foo(*a);
19   return b;
20 }
21 }
22 
23 namespace test1 {
24 // CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def]
25 struct foo {
26 };
27 
28 extern int bar(foo *a);
baz(foo * a)29 int baz(foo *a) {
30   return bar(a);
31 }
32 }
33 
34 namespace test2 {
35 // FIXME: if we were a bit fancier, we could realize that the 'foo' type is only
36 // required because of the 'bar' type which is not required at all (or might
37 // only be required to be declared)
38 // CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def]
39 struct foo {
40 };
41 
42 struct bar {
43   foo f;
44 };
45 
func()46 void func() {
47   foo *f;
48 }
49 }
50