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