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