55 lines · cpp
1// RUN: %clang_cc1 -triple x86_64-apple-darwin -debug-info-kind=standalone -o - -emit-llvm %s | FileCheck %s2 3// We had a bug in -fstandalone-debug where UnicodeString would not be completed4// when it was required to be complete. This originally manifested as an5// assertion in CodeView emission on Windows with some dllexport stuff, but it's6// more general than that.7 8struct UnicodeString;9UnicodeString *force_fwd_decl;10struct UnicodeString {11private:12 virtual ~UnicodeString();13};14struct UseCompleteType {15 UseCompleteType();16 ~UseCompleteType();17 UnicodeString currencySpcAfterSym[1];18};19UseCompleteType require_complete;20// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "UnicodeString"21// CHECK-NOT: DIFlagFwdDecl22// CHECK-SAME: ){{$}}23 24namespace rdar14101097_1 { // see also PR1621425// Check that we emit debug info for the definition of a struct if the26// definition is available, even if it's used via a pointer wrapped in a27// typedef.28// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "foo"29// CHECK-NOT: DIFlagFwdDecl30// CHECK-SAME: ){{$}}31struct foo {32};33 34typedef foo *foop;35 36void bar() {37 foop f;38}39}40 41namespace rdar14101097_2 {42// As above, except trickier because we first encounter only a declaration of43// the type and no debug-info related use after we see the definition of the44// type.45// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "foo"46// CHECK-NOT: DIFlagFwdDecl47// CHECK-SAME: ){{$}}48struct foo;49void bar() {50 foo *f;51}52struct foo {53};54}55