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