From: Timur Iskhodzhanov Date: Wed, 23 Apr 2014 12:46:26 +0000 (+0000) Subject: Add yet another vtordisp test X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f0e18f77f5ceaee634653c3a80f79298d7b7407;p=clang Add yet another vtordisp test git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206974 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp b/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp index 066c8912fd..f63808a898 100644 --- a/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp +++ b/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp @@ -535,3 +535,35 @@ struct X : C, virtual B { void build_vftable(X *obj) { obj->g(); } } + +namespace pr19519 { +// VS2013 CL miscompiles this, just make sure we don't regress. + +struct A { + virtual void f(); + virtual void g(); +}; + +struct B : virtual A { + virtual void f(); + B(); +}; + +struct C : virtual A { + virtual void g(); +}; + +struct X : B, C { + X(); + + // CHECK-LABEL: VFTable for 'pr19519::A' in 'pr19519::B' in 'pr19519::X' (2 entries). + // CHECK-NEXT: 0 | void pr19519::B::f() + // CHECK-NEXT: [this adjustment: vtordisp at -4, -4 non-virtual] + // CHECK-NEXT: 1 | void pr19519::C::g() + // CHECK-NEXT: [this adjustment: vtordisp at -4, -4 non-virtual] + + // MANGLING-DAG: @"\01??_7X@pr19519@@6B@" = {{.*}}@"\01?g@C@pr19519@@$4PPPPPPPM@3AEXXZ" +}; + +X::X() {} +}