summaryrefslogtreecommitdiff
path: root/tools/swig/test/Fortran.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'tools/swig/test/Fortran.cxx')
-rw-r--r--tools/swig/test/Fortran.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/swig/test/Fortran.cxx b/tools/swig/test/Fortran.cxx
new file mode 100644
index 000000000..475d21ddc
--- /dev/null
+++ b/tools/swig/test/Fortran.cxx
@@ -0,0 +1,24 @@
+#include <stdlib.h>
+#include <math.h>
+#include <iostream>
+#include "Fortran.h"
+
+#define TEST_FUNCS(TYPE, SNAME) \
+\
+TYPE SNAME ## SecondElement(TYPE * matrix, int rows, int cols) { \
+ TYPE result = matrix[1]; \
+ return result; \
+} \
+
+TEST_FUNCS(signed char , schar )
+TEST_FUNCS(unsigned char , uchar )
+TEST_FUNCS(short , short )
+TEST_FUNCS(unsigned short , ushort )
+TEST_FUNCS(int , int )
+TEST_FUNCS(unsigned int , uint )
+TEST_FUNCS(long , long )
+TEST_FUNCS(unsigned long , ulong )
+TEST_FUNCS(long long , longLong )
+TEST_FUNCS(unsigned long long, ulongLong)
+TEST_FUNCS(float , float )
+TEST_FUNCS(double , double )