Files
clang-p2996/llvm/test/Demangle/ms-operators.test
Zachary Turner 32a8a2028c [MS Demangler] Fix several crashes and demangling bugs.
These bugs were found by writing a Python script which spidered
the entire Chromium build directory tree demangling every symbol
in every object file.  At the start, the tool printed:

  Processed 27443 object files.
  2926377/2936108 symbols successfully demangled (99.6686%)
  9731 symbols could not be demangled (0.3314%)
  14589 files crashed while demangling (53.1611%)

After this patch, it prints:

  Processed 27443 object files.
  41295518/41295617 symbols successfully demangled (99.9998%)
  99 symbols could not be demangled (0.0002%)
  0 files crashed while demangling (0.0000%)

The issues fixed in this patch are:

  * Ignore empty parameter packs.  Previously we would encounter
    a mangling for an empty parameter pack and add a null node
    to the AST.  Since we don't print these anyway, we now just
    don't add anything to the AST and ignore it entirely.  This
    fixes some of the crashes.

  * Account for "incorrect" string literal demanglings.  Apparently
    an older version of clang would not truncate mangled string
    literals to 32 bytes of encoded character data.  The demangling
    code however would allocate a 32 byte buffer thinking that it
    would not encounter more than this, and overrun the buffer.
    We now demangle up to 128 bytes of data, since the buggy
    clang would encode up to 32 *characters* of data.

  * Extended support for demangling init-fini stubs.  If you had
    something like
      struct Foo {
        static vector<string> S;
      };
    this would generate a dynamic atexit initializer *for the
    variable*.  We didn't handle this, but now we print something
    nice.  This is actually an improvement over undname, which will
    fail to demangle this at all.

  * Fixed one case of static this adjustment.  We weren't handling
    several thunk codes so we didn't recognize the mangling.  These
    are now handled.

  * Fixed a back-referencing problem.  Member pointer templates
    should have their components considered for back-referencing

The remaining 99 symbols which can't be demangled are all symbols
which are compiler-generated and undname can't demangle either.

llvm-svn: 341000
2018-08-29 23:56:09 +00:00

236 lines
5.7 KiB
Plaintext

; RUN: llvm-undname < %s | FileCheck %s
; CHECK-NOT: Invalid mangled name
??0Base@@QEAA@XZ
; CHECK: __cdecl Base::Base(void)
??1Base@@UEAA@XZ
; CHECK: virtual __cdecl Base::~Base(void)
??2@YAPEAX_K@Z
; CHECK: void * __cdecl operator new(unsigned __int64)
??3@YAXPEAX_K@Z
; CHECK: void __cdecl operator delete(void *, unsigned __int64)
??4Base@@QEAAHH@Z
; CHECK: int __cdecl Base::operator=(int)
??6Base@@QEAAHH@Z
; CHECK: int __cdecl Base::operator<<(int)
??5Base@@QEAAHH@Z
; CHECK: int __cdecl Base::operator>>(int)
??7Base@@QEAAHXZ
; CHECK: int __cdecl Base::operator!(void)
??8Base@@QEAAHH@Z
; CHECK: int __cdecl Base::operator==(int)
??9Base@@QEAAHH@Z
; CHECK: int __cdecl Base::operator!=(int)
??ABase@@QEAAHH@Z
; CHECK: int __cdecl Base::operator[](int)
??BBase@@QEAAHXZ
; CHECK: __cdecl Base::operator int(void)
??CBase@@QEAAHXZ
; CHECK: int __cdecl Base::operator->(void)
??DBase@@QEAAHXZ
; CHECK: int __cdecl Base::operator*(void)
??EBase@@QEAAHXZ
; CHECK: int __cdecl Base::operator++(void)
??EBase@@QEAAHH@Z
; CHECK: int __cdecl Base::operator++(int)
??FBase@@QEAAHXZ
; CHECK: int __cdecl Base::operator--(void)
??FBase@@QEAAHH@Z
; CHECK: int __cdecl Base::operator--(int)
??GBase@@QEAAHH@Z
; CHECK: int __cdecl Base::operator-(int)
??HBase@@QEAAHH@Z
; CHECK: int __cdecl Base::operator+(int)
??IBase@@QEAAHH@Z
; CHECK: int __cdecl Base::operator&(int)
??JBase@@QEAAHH@Z
; CHECK: int __cdecl Base::operator->*(int)
??KBase@@QEAAHH@Z
; CHECK: int __cdecl Base::operator/(int)
??LBase@@QEAAHH@Z
; CHECK: int __cdecl Base::operator%(int)
??MBase@@QEAAHH@Z
; CHECK: int __cdecl Base::operator<(int)
??NBase@@QEAAHH@Z
; CHECK: int __cdecl Base::operator<=(int)
??OBase@@QEAAHH@Z
; CHECK: int __cdecl Base::operator>(int)
??PBase@@QEAAHH@Z
; CHECK: int __cdecl Base::operator>=(int)
??QBase@@QEAAHH@Z
; CHECK: int __cdecl Base::operator,(int)
??RBase@@QEAAHXZ
; CHECK: int __cdecl Base::operator()(void)
??SBase@@QEAAHXZ
; CHECK: int __cdecl Base::operator~(void)
??TBase@@QEAAHH@Z
; CHECK: int __cdecl Base::operator^(int)
??UBase@@QEAAHH@Z
; CHECK: int __cdecl Base::operator|(int)
??VBase@@QEAAHH@Z
; CHECK: int __cdecl Base::operator&&(int)
??WBase@@QEAAHH@Z
; CHECK: int __cdecl Base::operator||(int)
??XBase@@QEAAHH@Z
; CHECK: int __cdecl Base::operator*=(int)
??YBase@@QEAAHH@Z
; CHECK: int __cdecl Base::operator+=(int)
??ZBase@@QEAAHH@Z
; CHECK: int __cdecl Base::operator-=(int)
??_0Base@@QEAAHH@Z
; CHECK: int __cdecl Base::operator/=(int)
??_1Base@@QEAAHH@Z
; CHECK: int __cdecl Base::operator%=(int)
??_2Base@@QEAAHH@Z
; CHECK: int __cdecl Base::operator>>=(int)
??_3Base@@QEAAHH@Z
; CHECK: int __cdecl Base::operator<<=(int)
??_4Base@@QEAAHH@Z
; CHECK: int __cdecl Base::operator&=(int)
??_5Base@@QEAAHH@Z
; CHECK: int __cdecl Base::operator|=(int)
??_6Base@@QEAAHH@Z
; CHECK: int __cdecl Base::operator^=(int)
??_7Base@@6B@
; CHECK: const Base::`vftable'
??_7A@B@@6BC@D@@@
; CHECK: const B::A::`vftable'{for `D::C'}
??_8Middle2@@7B@
; CHECK: const Middle2::`vbtable'
??_9Base@@$B7AA
; CHECK: [thunk]: __cdecl Base::`vcall'{8, {flat}}
??_B?1??getS@@YAAAUS@@XZ@51
; CHECK: `struct S & __cdecl getS(void)'::`2'::`local static guard'{2}
??_C@_02PCEFGMJL@hi?$AA@
; CHECK: const char * {"hi"}
??_DDiamond@@QEAAXXZ
; CHECK: void __cdecl Diamond::`vbase dtor'(void)
??_EBase@@UEAAPEAXI@Z
; CHECK: virtual void * __cdecl Base::`vector deleting dtor'(unsigned int)
??_EBase@@G3AEPAXI@Z
; CHECK: [thunk]: void * __thiscall Base::`vector deleting dtor'`adjustor{4}'(unsigned int)
??_F?$SomeTemplate@H@@QAEXXZ
; CHECK: void __thiscall SomeTemplate<int>::`default ctor closure'(void)
??_GBase@@UEAAPEAXI@Z
; CHECK: virtual void * __cdecl Base::`scalar deleting dtor'(unsigned int)
??_H@YAXPEAX_K1P6APEAX0@Z@Z
; CHECK: void __cdecl `vector ctor iterator'(void *, unsigned __int64, unsigned __int64, void * (__cdecl *)(void *))
??_I@YAXPEAX_K1P6AX0@Z@Z
; CHECK: void __cdecl `vector dtor iterator'(void *, unsigned __int64, unsigned __int64, void (__cdecl *)(void *))
??_JBase@@UEAAPEAXI@Z
; CHECK: virtual void * __cdecl Base::`vector vbase ctor iterator'(unsigned int)
??_KBase@@UEAAPEAXI@Z
; CHECK: virtual void * __cdecl Base::`virtual displacement map'(unsigned int)
??_LBase@@UEAAPEAXI@Z
; CHECK: virtual void * __cdecl Base::`eh vector ctor iterator'(unsigned int)
??_MBase@@UEAAPEAXI@Z
; CHECK: virtual void * __cdecl Base::`eh vector dtor iterator'(unsigned int)
??_NBase@@UEAAPEAXI@Z
; CHECK: virtual void * __cdecl Base::`eh vector vbase ctor iterator'(unsigned int)
??_O?$SomeTemplate@H@@QAEXXZ
; CHECK: void __thiscall SomeTemplate<int>::`copy ctor closure'(void)
??_SBase@@6B@
; CHECK: const Base::`local vftable'
??_TDerived@@QEAAXXZ
; CHECK: void __cdecl Derived::`local vftable ctor closure'(void)
??_U@YAPEAX_KAEAVklass@@@Z
; CHECK: void * __cdecl operator new[](unsigned __int64, class klass &)
??_V@YAXPEAXAEAVklass@@@Z
; CHECK: void __cdecl operator delete[](void *, class klass &)
??_R0?AUBase@@@8
; CHECK: struct Base `RTTI Type Descriptor'
??_R1A@?0A@EA@Base@@8
; CHECK: Base::`RTTI Base Class Descriptor at (0, -1, 0, 64)'
??_R2Base@@8
; CHECK: Base::`RTTI Base Class Array'
??_R3Base@@8
; CHECK: Base::`RTTI Class Hierarchy Descriptor'
??_R4Base@@6B@
; CHECK: const Base::`RTTI Complete Object Locator'
??__EFoo@@YAXXZ
; CHECK: void __cdecl `dynamic initializer for 'Foo''(void)
??__FFoo@@YAXXZ
; CHECK: void __cdecl `dynamic atexit destructor for 'Foo''(void)
??__F_decisionToDFA@XPathLexer@@0V?$vector@VDFA@dfa@antlr4@@V?$allocator@VDFA@dfa@antlr4@@@std@@@std@@A@YAXXZ
; CHECK: void __cdecl `dynamic atexit destructor for `static class std::vector<class antlr4::dfa::DFA, class std::allocator<class antlr4::dfa::DFA>> XPathLexer::_decisionToDFA''(void)
??__K_deg@@YAHO@Z
; CHECK: int __cdecl operator ""_deg(long double)