aboutsummaryrefslogtreecommitdiff
path: root/test cases/fortran
diff options
context:
space:
mode:
Diffstat (limited to 'test cases/fortran')
-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.f9023
-rw-r--r--test cases/fortran/15 include/meson.build10
-rw-r--r--test cases/fortran/15 include/timestwo.f902
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