1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -Wno-microsoft -fms-extensions -fno-rtti -std=c++11 -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s 2*0a6a1f1dSLionel Sambuc 3*0a6a1f1dSLionel Sambuc template <typename T, int (T::*)() = nullptr> 4*0a6a1f1dSLionel Sambuc struct J {}; 5*0a6a1f1dSLionel Sambuc 6*0a6a1f1dSLionel Sambuc struct __single_inheritance M; 7*0a6a1f1dSLionel Sambuc J<M> m; 8*0a6a1f1dSLionel Sambuc // CHECK-DAG: @"\01?m@@3U?$J@UM@@$0A@@@A" 9*0a6a1f1dSLionel Sambuc 10*0a6a1f1dSLionel Sambuc struct __multiple_inheritance N; 11*0a6a1f1dSLionel Sambuc J<N> n; 12*0a6a1f1dSLionel Sambuc // CHECK-DAG: @"\01?n@@3U?$J@UN@@$HA@@@A" 13*0a6a1f1dSLionel Sambuc 14*0a6a1f1dSLionel Sambuc struct __virtual_inheritance O; 15*0a6a1f1dSLionel Sambuc J<O> o; 16*0a6a1f1dSLionel Sambuc // CHECK-DAG: @"\01?o@@3U?$J@UO@@$IA@A@@@A" 17*0a6a1f1dSLionel Sambuc 18*0a6a1f1dSLionel Sambuc struct P; 19*0a6a1f1dSLionel Sambuc J<P> p; 20*0a6a1f1dSLionel Sambuc // CHECK-DAG: @"\01?p@@3U?$J@UP@@$JA@A@?0@@A" 21*0a6a1f1dSLionel Sambuc 22*0a6a1f1dSLionel Sambuc #pragma pointers_to_members(full_generality, virtual_inheritance) 23*0a6a1f1dSLionel Sambuc 24*0a6a1f1dSLionel Sambuc struct S { 25*0a6a1f1dSLionel Sambuc int a, b; 26*0a6a1f1dSLionel Sambuc void f(); 27*0a6a1f1dSLionel Sambuc virtual void g(); 28*0a6a1f1dSLionel Sambuc }; 29*0a6a1f1dSLionel Sambuc 30*0a6a1f1dSLionel Sambuc struct GeneralBase { 31*0a6a1f1dSLionel Sambuc virtual void h(); 32*0a6a1f1dSLionel Sambuc }; 33*0a6a1f1dSLionel Sambuc struct MostGeneral : S, virtual GeneralBase { 34*0a6a1f1dSLionel Sambuc virtual void h(); 35*0a6a1f1dSLionel Sambuc }; 36*0a6a1f1dSLionel Sambuc template <void (MostGeneral::*MP)()> 37*0a6a1f1dSLionel Sambuc struct ClassTemplate { ClassTemplateClassTemplate38*0a6a1f1dSLionel Sambuc ClassTemplate() {} 39*0a6a1f1dSLionel Sambuc }; 40*0a6a1f1dSLionel Sambuc 41*0a6a1f1dSLionel Sambuc template struct ClassTemplate<&MostGeneral::h>; 42*0a6a1f1dSLionel Sambuc 43*0a6a1f1dSLionel Sambuc // Test that we mangle in the vbptr offset, which is 12 here. 44*0a6a1f1dSLionel Sambuc // 45*0a6a1f1dSLionel Sambuc // CHECK: define weak_odr x86_thiscallcc %struct.ClassTemplate* @"\01??0?$ClassTemplate@$J??_9MostGeneral@@$BA@AEA@M@3@@QAE@XZ" 46