diff options
author | Michael Hirsch <scivision@users.noreply.github.com> | 2020-06-08 00:13:18 -0400 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2020-06-14 14:55:49 +0000 |
commit | e2379148a61f47107e7a84f235ca31f76fe26ac1 (patch) | |
tree | a905b4ddba61ab7a61361bd47990de715b891132 /test cases | |
parent | 977dc4d19f849ed5db39d1d2399e506969aee709 (diff) | |
download | meson-e2379148a61f47107e7a84f235ca31f76fe26ac1.zip meson-e2379148a61f47107e7a84f235ca31f76fe26ac1.tar.gz meson-e2379148a61f47107e7a84f235ca31f76fe26ac1.tar.bz2 |
fortran generated test: add code to reveal issue
used with Issue #7265
Diffstat (limited to 'test cases')
-rw-r--r-- | test cases/fortran/7 generated/meson.build | 7 | ||||
-rw-r--r-- | test cases/fortran/7 generated/mod1.fpp | 4 | ||||
-rw-r--r-- | test cases/fortran/7 generated/mod2.fpp | 6 | ||||
-rw-r--r-- | test cases/fortran/7 generated/mod3.fpp | 6 | ||||
-rw-r--r-- | test cases/fortran/7 generated/prog.f90 | 9 |
5 files changed, 22 insertions, 10 deletions
diff --git a/test cases/fortran/7 generated/meson.build b/test cases/fortran/7 generated/meson.build index c2efe34..cbdbe4e 100644 --- a/test cases/fortran/7 generated/meson.build +++ b/test cases/fortran/7 generated/meson.build @@ -6,6 +6,11 @@ project('generated', 'fortran') conf_data = configuration_data() conf_data.set('ONE', 1) conf_data.set('TWO', 2) +conf_data.set('THREE', 3) + +outfile = configure_file( + input : 'mod3.fpp', output : 'mod3.f90', configuration : conf_data) +three = library('mod3', meson.current_build_dir() / 'mod3.f90') templates_basenames = ['mod2', 'mod1'] generated_sources = [] @@ -18,5 +23,5 @@ foreach template_basename : templates_basenames endforeach sources = ['prog.f90'] + generated_sources -exe = executable('generated', sources) +exe = executable('generated', sources, link_with: three) test('generated', exe) diff --git a/test cases/fortran/7 generated/mod1.fpp b/test cases/fortran/7 generated/mod1.fpp index 42d1fde..c4decf6 100644 --- a/test cases/fortran/7 generated/mod1.fpp +++ b/test cases/fortran/7 generated/mod1.fpp @@ -1,6 +1,6 @@ module mod1 - implicit none +implicit none - integer, parameter :: modval1 = @ONE@ +integer, parameter :: modval1 = @ONE@ end module mod1 diff --git a/test cases/fortran/7 generated/mod2.fpp b/test cases/fortran/7 generated/mod2.fpp index 594e9df..78ceae4 100644 --- a/test cases/fortran/7 generated/mod2.fpp +++ b/test cases/fortran/7 generated/mod2.fpp @@ -1,7 +1,7 @@ module mod2 - use mod1 - implicit none +use mod1, only : modval1 +implicit none - integer, parameter :: modval2 = @TWO@ +integer, parameter :: modval2 = @TWO@ end module mod2 diff --git a/test cases/fortran/7 generated/mod3.fpp b/test cases/fortran/7 generated/mod3.fpp new file mode 100644 index 0000000..ab3db65 --- /dev/null +++ b/test cases/fortran/7 generated/mod3.fpp @@ -0,0 +1,6 @@ +module mod3 +implicit none + +integer, parameter :: modval3 = @THREE@ + +end module mod3 diff --git a/test cases/fortran/7 generated/prog.f90 b/test cases/fortran/7 generated/prog.f90 index 8a102c0..6ee0bca 100644 --- a/test cases/fortran/7 generated/prog.f90 +++ b/test cases/fortran/7 generated/prog.f90 @@ -1,7 +1,8 @@ -program prog -use mod2 +program generated +use mod2, only : modval1, modval2 +use mod3, only : modval3 implicit none -if (modval1 + modval2 /= 3) stop 1 +if (modval1 + modval2 + modval3 /= 6) error stop -end program prog +end program generated |