diff options
author | Reid Kleckner <rnk@google.com> | 2016-09-09 17:03:53 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2016-09-09 17:03:53 +0000 |
commit | 22466a92e164f43aba45e9722cf62ee1bd47b246 (patch) | |
tree | 0d13ea4018c6ca6bf29386d1a14e39452ef2ff28 /clang/test/CodeGenCXX/debug-info-class-nolimit.cpp | |
parent | b6bee5164d2a0a9fc9b131b8354413486abea110 (diff) | |
download | bcm5719-llvm-22466a92e164f43aba45e9722cf62ee1bd47b246.tar.gz bcm5719-llvm-22466a92e164f43aba45e9722cf62ee1bd47b246.zip |
[DebugInfo] Ensure complete type is emitted with -fstandalone-debug
The logic for upgrading a class from a forward decl to a complete type
was not checking the debug info emission level before applying the
vtable optimization. This meant we ended up without debug info for a
class which was required to be complete. I noticed it because it
triggered an assertion during CodeView emission, but that's a separate
issue.
llvm-svn: 281057
Diffstat (limited to 'clang/test/CodeGenCXX/debug-info-class-nolimit.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/debug-info-class-nolimit.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/clang/test/CodeGenCXX/debug-info-class-nolimit.cpp b/clang/test/CodeGenCXX/debug-info-class-nolimit.cpp index ce47f9fa495..4b05fd6e87d 100644 --- a/clang/test/CodeGenCXX/debug-info-class-nolimit.cpp +++ b/clang/test/CodeGenCXX/debug-info-class-nolimit.cpp @@ -1,8 +1,29 @@ -// RUN: %clang_cc1 -triple x86_64-unk-unk -debug-info-kind=standalone -o - -emit-llvm %s | FileCheck %s -// On Darwin, "full" debug info is the default, so really these tests are -// identical, as cc1 no longer chooses the effective value of DebugInfoKind. // RUN: %clang_cc1 -triple x86_64-apple-darwin -debug-info-kind=standalone -o - -emit-llvm %s | FileCheck %s +// We had a bug in -fstandalone-debug where UnicodeString would not be completed +// when it was required to be complete. This orginally manifested as an +// assertion in CodeView emission on Windows with some dllexport stuff, but it's +// more general than that. + +struct UnicodeString; +struct GetFwdDecl { + static UnicodeString format; +}; +GetFwdDecl force_fwd_decl; +struct UnicodeString { +private: + virtual ~UnicodeString(); +}; +struct UseCompleteType { + UseCompleteType(); + ~UseCompleteType(); + UnicodeString currencySpcAfterSym[1]; +}; +UseCompleteType require_complete; +// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "UnicodeString" +// CHECK-NOT: DIFlagFwdDecl +// CHECK-SAME: ){{$}} + namespace rdar14101097_1 { // see also PR16214 // Check that we emit debug info for the definition of a struct if the // definition is available, even if it's used via a pointer wrapped in a |