use crate::spec::expect_parse_success;
mod fortran_interface {
use super::*;
#[test]
fn mls_12_8_fortran_basic() {
expect_parse_success(
r#"
function FortranFunc
input Real x;
output Real y;
external "FORTRAN 77";
end FortranFunc;
"#,
);
}
#[test]
fn mls_12_8_fortran_explicit_name() {
expect_parse_success(
r#"
function MyFunc
input Real x;
output Real y;
external "FORTRAN 77" y = fortran_func(x);
end MyFunc;
"#,
);
}
#[test]
fn mls_12_8_fortran_library() {
expect_parse_success(
r#"
function BLASFunc
input Real x[3];
output Real y;
external "FORTRAN 77" y = ddot(3, x, 1, x, 1)
annotation(Library = "blas");
end BLASFunc;
"#,
);
}
#[test]
fn mls_12_8_fortran_arrays() {
expect_parse_success(
r#"
function FortranArray
input Real A[:,:];
input Integer m;
input Integer n;
output Real result;
external "FORTRAN 77";
end FortranArray;
"#,
);
}
#[test]
fn mls_12_8_fortran_strings() {
expect_parse_success(
r#"
function FortranString
input String s;
output Integer len;
external "FORTRAN 77";
end FortranString;
"#,
);
}
#[test]
fn mls_12_8_fortran_subroutine() {
expect_parse_success(
r#"
function FortranSub
input Real x;
output Real y;
external "FORTRAN 77";
end FortranSub;
"#,
);
}
#[test]
fn mls_12_8_fortran_multi_output() {
expect_parse_success(
r#"
function FortranMultiOut
input Real x;
output Real y1;
output Real y2;
external "FORTRAN 77";
end FortranMultiOut;
"#,
);
}
}