summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/dllexport-MI1.C
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/g++.dg/ext/dllexport-MI1.C
downloadcbb-gcc-4.6.4-upstream.tar.bz2
cbb-gcc-4.6.4-upstream.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/g++.dg/ext/dllexport-MI1.C')
-rw-r--r--gcc/testsuite/g++.dg/ext/dllexport-MI1.C51
1 files changed, 51 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/ext/dllexport-MI1.C b/gcc/testsuite/g++.dg/ext/dllexport-MI1.C
new file mode 100644
index 000000000..08e65ec96
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/dllexport-MI1.C
@@ -0,0 +1,51 @@
+// { dg-do compile { target i?86-*-cygwin* i?86-*-mingw* x86_64-*-mingw*} }
+// Test that non-virtual MI thunks are exported.
+
+
+// To build the dll and client app:
+// g++ -shared -o MI.dll dllexport-MI1.C
+// g++ -o MItest.exe dllimport-MI1.C -L. MI.dll
+
+#define BUILDING_MI_DLL
+#include "dll-MI1.h"
+
+MBase::~MBase(){}
+
+int D1::vf() const { return D1_return; }
+
+D2::D2() { }
+D2::D2 (D2 const&) { }
+int D2::vf() const { return D2_return; }
+
+int MI1::vf() const { return D1::vf();}
+
+// a dllexported object
+DLL_IMPEXP MI1 dllMI1;
+
+// use default copy ctor
+DLL_IMPEXP MI1 dllMI1Copy = dllMI1;
+
+// Scan for export of some methods that are undefined in dllimportMI1.C,
+
+// { dg-final { scan-assembler "-export:\[\\\\\"\]*_ZNK2D12vfEv" } }
+// { dg-final { scan-assembler "-export:\[\\\\\"\]*_ZNK2D22vfEv" } }
+// { dg-final { scan-assembler "-export:\[\\\\\"\]*_ZNK3MI12vfEv" } }
+
+// and MI thunks,
+
+// { dg-final { scan-assembler "-export:\[\\\\\"\]*_ZThn._NK3MI12vfEv" } }
+// { dg-final { scan-assembler "-export:\[\\\\\"\]*_ZTv0_n.._NK2D12vfEv" } }
+
+// and a vtable data variable.
+
+// { dg-final { scan-assembler "-export:\[\\\\\"\]*_ZTV2D1\[\\\\\"\]*,data" } }
+
+// an explicit copy ctor
+// { dg-final { scan-assembler "-export:\[\\\\\"\]*_ZN2D2C2ERKS_" } }
+
+// but not implicit copy ctor generated by compiler
+// nor implicit dtor
+
+// { dg-final { scan-assembler-not "-export:\[\\\\\"\]*_ZN2D1C2ERKS_" } }
+// { dg-final { scan-assembler-not "-export:\[\\\\\"\]*_ZN2D1D2Ev" } }
+