summaryrefslogtreecommitdiff
path: root/Examples/test-suite/function_typedef.i
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/function_typedef.i')
-rw-r--r--Examples/test-suite/function_typedef.i20
1 files changed, 20 insertions, 0 deletions
diff --git a/Examples/test-suite/function_typedef.i b/Examples/test-suite/function_typedef.i
new file mode 100644
index 0000000..718af9c
--- /dev/null
+++ b/Examples/test-suite/function_typedef.i
@@ -0,0 +1,20 @@
+%module function_typedef
+
+%inline %{
+
+typedef int binop_t(int, int);
+
+int do_binop1(binop_t f, int x, int y) {
+ return f(x,y);
+}
+
+int do_binop2(binop_t *f, int x, int y) {
+ return (*f)(x,y);
+}
+
+int do_binop3(int f(int,int), int x, int y) {
+ return f(x,y);
+}
+%}
+
+