fortran include syntax checks

minvers
pull/5546/head
Michael Hirsch, Ph.D 5 years ago committed by Jussi Pakkanen
parent 40a3a6c3d0
commit c8d144b064
  1. 0
      test cases/fortran/15 include/include_hierarchy.f90
  2. 23
      test cases/fortran/15 include/include_syntax.f90
  3. 10
      test cases/fortran/15 include/meson.build
  4. 2
      test cases/fortran/15 include/timestwo.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

@ -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)
Loading…
Cancel
Save