Home | History | Annotate | Download | only in CodeGenCXX
      1 // RUN: %clang -emit-llvm -fno-standalone-debug -g -S %s -o - | FileCheck %s
      2 
      3 namespace PR16214_1 {
      4 // CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def]
      5 struct foo {
      6   int i;
      7 };
      8 
      9 typedef foo bar;
     10 
     11 bar *a;
     12 bar b;
     13 }
     14 
     15 namespace PR14467 {
     16 // CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def]
     17 struct foo {
     18 };
     19 
     20 foo *bar(foo *a) {
     21   foo *b = new foo(*a);
     22   return b;
     23 }
     24 }
     25 
     26 namespace test1 {
     27 // CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def]
     28 struct foo {
     29 };
     30 
     31 extern int bar(foo *a);
     32 int baz(foo *a) {
     33   return bar(a);
     34 }
     35 }
     36 
     37 namespace 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]
     42 struct foo {
     43 };
     44 
     45 struct bar {
     46   foo f;
     47 };
     48 
     49 void func() {
     50   foo *f;
     51 }
     52 }
     53