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