]> granicus.if.org Git - clang/commitdiff
[MS] Test that deleting destructor thunks are not exported
authorReid Kleckner <rnk@google.com>
Fri, 30 Jun 2017 16:12:14 +0000 (16:12 +0000)
committerReid Kleckner <rnk@google.com>
Fri, 30 Jun 2017 16:12:14 +0000 (16:12 +0000)
The MSVC linker emits the LNK4102 warning if they are.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306836 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGenCXX/dllexport-dtor-thunks.cpp [new file with mode: 0644]

diff --git a/test/CodeGenCXX/dllexport-dtor-thunks.cpp b/test/CodeGenCXX/dllexport-dtor-thunks.cpp
new file mode 100644 (file)
index 0000000..52f9901
--- /dev/null
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -mconstructor-aliases -fms-extensions %s -emit-llvm -o - -triple x86_64-windows-msvc | FileCheck %s
+
+struct __declspec(dllexport) A { virtual ~A(); };
+struct __declspec(dllexport) B { virtual ~B(); };
+struct __declspec(dllexport) C : A, B { virtual ~C(); };
+C::~C() {}
+
+// This thunk should *not* be dllexport.
+// CHECK: define linkonce_odr i8* @"\01??_EC@@W7EAAPEAXI@Z"
+// CHECK: define dllexport void @"\01??1C@@UEAA@XZ"