blob: a4b9f46ec65336b6255988fa289519007159e640 [file] [log] [blame]
David Blaikie940ca4d2013-06-21 21:03:11 +00001// RUN: %clang -emit-llvm -g -S %s -o - | FileCheck %s
2
3namespace PR16214_1 {
David Blaikie48ad6dc2013-07-13 21:08:14 +00004// CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def]
David Blaikie940ca4d2013-06-21 21:03:11 +00005struct foo {
6 int i;
7};
8
9typedef foo bar;
10
David Blaikiebea8cc72013-06-21 21:23:18 +000011bar *a;
12bar b;
13}
14
David Blaikie48ad6dc2013-07-13 21:08:14 +000015namespace PR14467 {
16// CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def]
David Blaikiebea8cc72013-06-21 21:23:18 +000017struct foo {
David Blaikiebea8cc72013-06-21 21:23:18 +000018};
19
David Blaikie4686b162013-06-21 21:58:54 +000020foo *bar(foo *a) {
David Blaikiebea8cc72013-06-21 21:23:18 +000021 foo *b = new foo(*a);
22 return b;
23}
24}
25
David Blaikie48ad6dc2013-07-13 21:08:14 +000026namespace test1 {
27// CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [decl]
David Blaikiebea8cc72013-06-21 21:23:18 +000028struct foo {
David Blaikiebea8cc72013-06-21 21:23:18 +000029};
30
31extern int bar(foo *a);
32int baz(foo *a) {
33 return bar(a);
34}
David Blaikie940ca4d2013-06-21 21:03:11 +000035}
David Blaikie48ad6dc2013-07-13 21:08:14 +000036
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}