diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk index f3550f10a..d60a53e9e 100644 --- a/Examples/test-suite/common.mk +++ b/Examples/test-suite/common.mk @@ -159,6 +159,7 @@ CPP_TEST_CASES += \ extern_namespace \ extern_throws \ features \ + fvirtual \ friends \ global_ns_arg \ global_vars \ diff --git a/Examples/test-suite/fvirtual.i b/Examples/test-suite/fvirtual.i new file mode 100644 index 000000000..dd09fba3f --- /dev/null +++ b/Examples/test-suite/fvirtual.i @@ -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() {} + }; +%} + +