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