13ea9e33ea25e0c2b12db56418ba3f994eb662c04Pirama Arumuga Nainar// 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
23ea9e33ea25e0c2b12db56418ba3f994eb662c04Pirama Arumuga Nainar// 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
3e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis
4e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis// CHECK: @"\01??_7B@?1??foo@A@@QAEXH@Z@6B@" =
50e2c34f92f00628d48968dfea096d36381f494cbStephen Hines// CHECK: @"\01??_7D@C@?1??foo@@YAXXZ@6B@" =
63ea9e33ea25e0c2b12db56418ba3f994eb662c04Pirama Arumuga Nainar// MSVC2013: define {{.*}} @"\01?baz@E@?3??bar@C@?1??foo@@YAXXZ@QAEXXZ@QAEXXZ"(
73ea9e33ea25e0c2b12db56418ba3f994eb662c04Pirama Arumuga Nainar// MSVC2015: define {{.*}} @"\01?baz@E@?1??bar@C@?1??foo@@YAXXZ@QAEXXZ@QAEXXZ"(
8e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis
9e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis// Microsoft Visual C++ ABI examples.
10e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davisstruct A {
11e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis  void foo (int) {
12e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis    struct B { virtual ~B() {} };
13e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis    B();
14e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis  }
15e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis};
16651f13cea278ec967336033dd032faef0e9fc2ecStephen Hinesinline void foo () {
17e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis  struct C {
18e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis    struct D { virtual ~D() {} };
19e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis    void bar () {
20e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis      struct E {
21e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis        void baz() { }
22e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis      };
23e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis      E().baz();
24e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis    }
25e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis  };
26e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis  A().foo(0);
27e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis  C::D();
28e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis  C().bar();
29e0deb035b3e2d07b41ea55db84b110abcb65b753Charles Davis}
30651f13cea278ec967336033dd032faef0e9fc2ecStephen Hinesvoid call () {
31651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines  foo();
32651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines}
33