File: test_fortran2.mw

package info (click to toggle)
mwrap 1.3-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 1,548 kB
  • sloc: cpp: 3,315; python: 1,850; ansic: 856; makefile: 258; lex: 233; sh: 145
file content (15 lines) | stat: -rw-r--r-- 286 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function test_fortran2

$ #ifdef __cplusplus
$ extern "C"
$ #endif
$ int foo_(int* a, int* b, int* c)
$ {
$     *a = *b + *c;
$ }

# FORTRAN foo(output int* a, int 1, int 2);
tassert(a == 3, 'FORTRAN bindings');

function tassert(pred, msg)
if ~pred, fprintf('Failure: %s\n', msg); end