summaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/mangle-ms-abi-examples.cpp
blob: 6b6ad89b43441c93434ac19692d3c6e138bd3e08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// RUN: %clang_cc1 -fms-extensions -fno-rtti -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=19.00 | FileCheck %s --check-prefix=CHECK --check-prefix=MSVC2015
// RUN: %clang_cc1 -fms-extensions -fno-rtti -emit-llvm %s -o - -triple=i386-pc-win32 -fms-compatibility-version=18.00 | FileCheck %s --check-prefix=CHECK --check-prefix=MSVC2013

// CHECK: @"\01??_7B@?1??foo@A@@QAEXH@Z@6B@" =
// CHECK: @"\01??_7D@C@?1??foo@@YAXXZ@6B@" =
// MSVC2013: define {{.*}} @"\01?baz@E@?3??bar@C@?1??foo@@YAXXZ@QAEXXZ@QAEXXZ"(
// MSVC2015: define {{.*}} @"\01?baz@E@?1??bar@C@?1??foo@@YAXXZ@QAEXXZ@QAEXXZ"(

// Microsoft Visual C++ ABI examples.
struct A {
  void foo (int) {
    struct B { virtual ~B() {} };
    B();
  }
};
inline void foo () {
  struct C {
    struct D { virtual ~D() {} };
    void bar () {
      struct E {
        void baz() { }
      };
      E().baz();
    }
  };
  A().foo(0);
  C::D();
  C().bar();
}
void call () {
  foo();
}