diff options
author | Michael Hirsch, Ph.D <scivision@users.noreply.github.com> | 2019-06-23 10:56:05 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-06-23 21:11:16 +0300 |
commit | c8d144b064169f5e7b34b76c95a585d9e4ca5f44 (patch) | |
tree | 5b6e9b9e6b1fb944558bc61044751f8aeaad68c5 | |
parent | 40a3a6c3d0de657163b4046ee36f62f6b521536b (diff) | |
download | meson-c8d144b064169f5e7b34b76c95a585d9e4ca5f44.zip meson-c8d144b064169f5e7b34b76c95a585d9e4ca5f44.tar.gz meson-c8d144b064169f5e7b34b76c95a585d9e4ca5f44.tar.bz2 |
fortran include syntax checks
minvers
-rw-r--r-- | test cases/fortran/15 include/include_hierarchy.f90 (renamed from test cases/fortran/15 include/main.f90) | 0 | ||||
-rw-r--r-- | test cases/fortran/15 include/include_syntax.f90 | 23 | ||||
-rw-r--r-- | test cases/fortran/15 include/meson.build | 10 | ||||
-rw-r--r-- | test cases/fortran/15 include/timestwo.f90 | 2 |
4 files changed, 32 insertions, 3 deletions
diff --git a/test cases/fortran/15 include/main.f90 b/test cases/fortran/15 include/include_hierarchy.f90 index 661aa62..661aa62 100644 --- a/test cases/fortran/15 include/main.f90 +++ b/test cases/fortran/15 include/include_hierarchy.f90 diff --git a/test cases/fortran/15 include/include_syntax.f90 b/test cases/fortran/15 include/include_syntax.f90 new file mode 100644 index 0000000..d35e0ce --- /dev/null +++ b/test cases/fortran/15 include/include_syntax.f90 @@ -0,0 +1,23 @@ +implicit none + +integer :: x, y + +x = 1 +y = 0 + +! include "timestwo.f90" + +include "timestwo.f90" ! inline comment check +if (x/=2) error stop 'failed on first include' + +! leading space check + include 'timestwo.f90' +if (x/=4) error stop 'failed on second include' + +! Most Fortran compilers can't handle the non-standard #include, +! including (ha!) Flang, Gfortran, Ifort and PGI. +! #include "timestwo.f90" + +print *, 'OK: Fortran include tests: x=',x + +end program
\ No newline at end of file diff --git a/test cases/fortran/15 include/meson.build b/test cases/fortran/15 include/meson.build index 5609128..2196d13 100644 --- a/test cases/fortran/15 include/meson.build +++ b/test cases/fortran/15 include/meson.build @@ -1,4 +1,8 @@ -project('Inclusive', 'fortran') +project('Inclusive', 'fortran', + meson_version: '>= 0.51.1') -exe = executable('incexe', 'main.f90') -test('Fortran include files', exe) +hier_exe = executable('include_hierarchy', 'include_hierarchy.f90') +test('Fortran include file hierarchy', hier_exe) + +syntax_exe = executable('include_syntax', 'include_syntax.f90') +test('Fortran include file syntax', syntax_exe)
\ No newline at end of file diff --git a/test cases/fortran/15 include/timestwo.f90 b/test cases/fortran/15 include/timestwo.f90 new file mode 100644 index 0000000..0e2d5ac --- /dev/null +++ b/test cases/fortran/15 include/timestwo.f90 @@ -0,0 +1,2 @@ +x = 2*x +y = y+1
\ No newline at end of file |