diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/ext/dllimport12.C')
-rw-r--r-- | gcc/testsuite/g++.dg/ext/dllimport12.C | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/ext/dllimport12.C b/gcc/testsuite/g++.dg/ext/dllimport12.C new file mode 100644 index 000000000..ede546f20 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/dllimport12.C @@ -0,0 +1,23 @@ +// PR target/27650 +// Don't use dllimport semantics on virtual methods when initializing +// vtables +// { dg-do compile { target i?86-*-cygwin* i?86-*-mingw* x86_64-*-mingw* } } + +// Use import lib thunk for vtable entry of explicitly virtual method, +struct base +{ + virtual void key_method(); + __attribute__((dllimport)) virtual ~base(); +}; + +void base::key_method() {} + + +// Likewise for an implicitly virtual method. +struct derived : public base +{ + void key_method(); + __attribute__((dllimport)) ~derived(); +}; + +void derived::key_method() {} |