testcase for -fvirtual
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9376 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
fa40d8f98b
commit
ebffa5213f
2 changed files with 22 additions and 0 deletions
|
|
@ -159,6 +159,7 @@ CPP_TEST_CASES += \
|
||||||
extern_namespace \
|
extern_namespace \
|
||||||
extern_throws \
|
extern_throws \
|
||||||
features \
|
features \
|
||||||
|
fvirtual \
|
||||||
friends \
|
friends \
|
||||||
global_ns_arg \
|
global_ns_arg \
|
||||||
global_vars \
|
global_vars \
|
||||||
|
|
|
||||||
21
Examples/test-suite/fvirtual.i
Normal file
21
Examples/test-suite/fvirtual.i
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
// This testcase is tests corner cases for the -fvirtual optimisation flag.
|
||||||
|
// Note that the test-suite does not actually run with -fvirtual at any point, but this can be tested using the SWIG_FEATURES=-fvirtual env variable.
|
||||||
|
%module fvirtual
|
||||||
|
|
||||||
|
// Test overloaded methods #1508327 (requires a scripting language runtime test)
|
||||||
|
%inline %{
|
||||||
|
class Node {
|
||||||
|
public:
|
||||||
|
virtual int addChild( Node *child ) { return 1; }
|
||||||
|
virtual ~Node() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
class Switch : public Node {
|
||||||
|
public :
|
||||||
|
virtual int addChild( Node *child ) { return 2; } // This was hidden with -fvirtual
|
||||||
|
virtual int addChild( Node *child, bool value ) { return 3; }
|
||||||
|
virtual ~Switch() {}
|
||||||
|
};
|
||||||
|
%}
|
||||||
|
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue