Skip to content

Commit

Permalink
demonstrate that the old scanner is broken
Browse files Browse the repository at this point in the history
(if applied before the two step scanner, also make
`NinjaBackend.get_fortran_orderdeps()` a no-op)

run: the follwing in this test:
meson setup builddir
ninja -C builddir/ mod_name_case.p/test.f90.o -v -j1

Watch compilation fail, since we don't have a proper dependency order.
  • Loading branch information
dcbaker committed Jan 3, 2024
1 parent 92582f1 commit 3960b72
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion test cases/fortran/8 module names/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ project('mod_name_case', 'fortran')

sources = ['test.f90', 'mod1.f90', 'mod2.f90']

exe = executable('mod_name_case', sources)
l = static_library('s1', 'mod1.f90')
l2 = static_library('s2', 'mod2.f90', link_whole : l)

exe = executable('mod_name_case', 'test.f90', link_with : l2)
test('mod_name_case', exe)
8 changes: 8 additions & 0 deletions test cases/fortran/8 module names/mod2.f90
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
module mymod2
use mymod1
implicit none

integer, parameter :: myModVal2 = 2

contains
subroutine showvalues()
print*, "myModVal1 = ", myModVal1
print*, "myModVal2 = ", myModVal2
end subroutine showvalues


end module mymod2
3 changes: 1 addition & 2 deletions test cases/fortran/8 module names/test.f90
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
program main
use mymod1
use MyMod2 ! test inline comment

implicit none

integer, parameter :: testVar = myModVal1 + myModVal2
call showvalues()

end program

0 comments on commit 3960b72

Please sign in to comment.