File tree Expand file tree Collapse file tree 11 files changed +95
-0
lines changed Expand file tree Collapse file tree 11 files changed +95
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,16 @@ test ! -e ./build/gfortran_*/tree_shake/src_farewell_m.f90.o
70
70
test ! -e ./build/gfortran_* /tree_shake/src_farewell_m.f90.o.log
71
71
popd
72
72
73
+ pushd submodule_tree_shake
74
+ " $fpm " run
75
+ test ! -e ./build/gfortran_* /submodule_tree_shake/src_parent_unused.f90.o
76
+ test ! -e ./build/gfortran_* /submodule_tree_shake/src_parent_unused.f90.o.log
77
+ test ! -e ./build/gfortran_* /submodule_tree_shake/src_child_unused.f90.o
78
+ test ! -e ./build/gfortran_* /submodule_tree_shake/src_child_unused.f90.o.log
79
+ test ! -e ./build/gfortran_* /submodule_tree_shake/src_grandchild.f90.o
80
+ test ! -e ./build/gfortran_* /submodule_tree_shake/src_grandchild.f90.o.log
81
+ popd
82
+
73
83
pushd version_file
74
84
" $fpm " build
75
85
" $fpm " run
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ the features demonstrated in each package and which versions of fpm are supporte
21
21
| program_with_module | App-only; module+program in single source file | Y | Y |
22
22
| submodules | Lib-only; submodules (3 levels) | N | Y |
23
23
| tree_shake | Test tree-shaking/pruning of unused module dependencies | N | Y |
24
+ | submodule_tree_shake| Test tree-shaking/pruning with submodules dependencies | N | Y |
24
25
| link_external | Link external library | N | Y |
25
26
| link_executable | Link external library to a single executable | N | Y |
26
27
| version_file | Read version number from a file in the project root | N | Y |
Original file line number Diff line number Diff line change
1
+ build /*
Original file line number Diff line number Diff line change
1
+ program test
2
+ use parent
3
+
4
+ integer :: a, b
5
+
6
+ call my_sub1(a)
7
+ call my_sub2(b)
8
+
9
+ end program test
Original file line number Diff line number Diff line change
1
+ name = " submodule_tree_shake"
Original file line number Diff line number Diff line change
1
+ submodule(parent) child1
2
+ implicit none
3
+
4
+ interface
5
+ module function my_fun () result (b)
6
+ integer :: b
7
+ end function my_fun
8
+ end interface
9
+
10
+ contains
11
+
12
+ module procedure my_sub1
13
+ a = 1
14
+ end procedure my_sub1
15
+
16
+ end submodule child1
Original file line number Diff line number Diff line change
1
+ submodule(parent) child2
2
+ implicit none
3
+
4
+ contains
5
+
6
+ module procedure my_sub2
7
+ a = 2
8
+ end procedure my_sub2
9
+
10
+ end submodule child2
Original file line number Diff line number Diff line change
1
+ submodule(parent_unused) child_unused
2
+ implicit none
3
+
4
+ contains
5
+
6
+ module procedure unused_sub
7
+ a = 1
8
+ end procedure unused_sub
9
+
10
+ end submodule child_unused
Original file line number Diff line number Diff line change
1
+ submodule(parent:child1) grandchild
2
+ implicit none
3
+
4
+ contains
5
+
6
+ module procedure my_fun
7
+ b = 2
8
+ end procedure my_fun
9
+
10
+ end submodule grandchild
Original file line number Diff line number Diff line change
1
+ module parent
2
+ implicit none
3
+
4
+ interface
5
+
6
+ module subroutine my_sub1 (a )
7
+ integer , intent (out ) :: a
8
+ end subroutine my_sub1
9
+
10
+ module subroutine my_sub2 (a )
11
+ integer , intent (out ) :: a
12
+ end subroutine my_sub2
13
+ end interface
14
+
15
+ end module parent
You can’t perform that action at this time.
0 commit comments