Home | History | Annotate | Download | only in CodeGenCXX
      1 // RUN: %clang_cc1 -triple x86_64-unk-unk -debug-info-kind=standalone -o - -emit-llvm %s | FileCheck %s
      2 // On Darwin, "full" debug info is the default, so really these tests are
      3 // identical, as cc1 no longer chooses the effective value of DebugInfoKind.
      4 // RUN: %clang_cc1 -triple x86_64-apple-darwin -debug-info-kind=standalone -o - -emit-llvm %s | FileCheck %s
      5 
      6 namespace rdar14101097_1 { // see also PR16214
      7 // Check that we emit debug info for the definition of a struct if the
      8 // definition is available, even if it's used via a pointer wrapped in a
      9 // typedef.
     10 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "foo"
     11 // CHECK-NOT:              DIFlagFwdDecl
     12 // CHECK-SAME:             ){{$}}
     13 struct foo {
     14 };
     15 
     16 typedef foo *foop;
     17 
     18 void bar() {
     19   foop f;
     20 }
     21 }
     22 
     23 namespace rdar14101097_2 {
     24 // As above, except trickier because we first encounter only a declaration of
     25 // the type and no debug-info related use after we see the definition of the
     26 // type.
     27 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "foo"
     28 // CHECK-NOT:              DIFlagFwdDecl
     29 // CHECK-SAME:             ){{$}}
     30 struct foo;
     31 void bar() {
     32   foo *f;
     33 }
     34 struct foo {
     35 };
     36 }
     37