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:
William S Fulton 2006-09-28 21:53:23 +00:00
commit ebffa5213f
2 changed files with 22 additions and 0 deletions

View file

@ -159,6 +159,7 @@ CPP_TEST_CASES += \
extern_namespace \
extern_throws \
features \
fvirtual \
friends \
global_ns_arg \
global_vars \

View 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() {}
};
%}