summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/dllexport-missing-key.cpp
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2018-12-15 08:08:11 +0000
committerMartin Storsjo <martin@martin.st>2018-12-15 08:08:11 +0000
commit4790194b19e06cc3d333c89d1616a0e3b05498d2 (patch)
treecaa880b168c7a946c03d7a89dca51aad14b272bd /clang/test/CodeGenCXX/dllexport-missing-key.cpp
parenta53bb3ac8552551ee4d0716c628fef0850c09550 (diff)
downloadbcm5719-llvm-4790194b19e06cc3d333c89d1616a0e3b05498d2.tar.gz
bcm5719-llvm-4790194b19e06cc3d333c89d1616a0e3b05498d2.zip
[MinGW] Produce a vtable and RTTI for dllexported classes without a key function
This matches what GCC does in these situations. This fixes compiling Qt in debug mode. In release mode, references to the vtable of this particular class ends up optimized away, but in debug mode, the compiler creates references to the vtable, which is expected to be dllexported from a different DLL. Make sure the dllexported version actually ends up emitted. Differential Revision: https://reviews.llvm.org/D55698 llvm-svn: 349256
Diffstat (limited to 'clang/test/CodeGenCXX/dllexport-missing-key.cpp')
-rw-r--r--clang/test/CodeGenCXX/dllexport-missing-key.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/dllexport-missing-key.cpp b/clang/test/CodeGenCXX/dllexport-missing-key.cpp
new file mode 100644
index 00000000000..90e736f6fad
--- /dev/null
+++ b/clang/test/CodeGenCXX/dllexport-missing-key.cpp
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -triple x86_64-windows-gnu -emit-llvm -std=c++11 -o - %s | FileCheck --check-prefix=GNU %s
+
+class __declspec(dllexport) QAbstractLayoutStyleInfo {
+public:
+ QAbstractLayoutStyleInfo() : m_isWindow(false) {}
+ virtual ~QAbstractLayoutStyleInfo() {}
+
+ virtual bool hasChangedCore() const { return false; }
+
+ virtual void invalidate() {}
+
+ virtual double windowMargin(bool orientation) const = 0;
+
+ bool isWindow() const { return m_isWindow; }
+
+protected:
+ bool m_isWindow;
+};
+
+// GNU-DAG: @_ZTV24QAbstractLayoutStyleInfo = weak_odr dso_local dllexport
+// GNU-DAG: @_ZTS24QAbstractLayoutStyleInfo = linkonce_odr
+// GNU-DAG: @_ZTI24QAbstractLayoutStyleInfo = linkonce_odr
OpenPOWER on IntegriCloud