File tree Expand file tree Collapse file tree 5 files changed +30
-0
lines changed
example_packages/tree_shake Expand file tree Collapse file tree 5 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -3,5 +3,13 @@ program say_Hello
3
3
4
4
implicit none
5
5
6
+ interface
7
+ function external_function () result(i)
8
+ integer :: i
9
+ end function external_function
10
+ end interface
11
+
6
12
print * , make_greeting(" World" )
13
+ print * , external_function()
14
+
7
15
end program say_Hello
Original file line number Diff line number Diff line change
1
+ ! This module is not used by any other sources,
2
+ ! however because it also contains an external function
3
+ ! it cannot be dropped during tree-shaking/pruning
4
+ module extra_m
5
+ use subdir_constants, only: FAREWELL_STR
6
+ implicit none
7
+ private
8
+
9
+ integer , parameter :: m = 0
10
+ end
11
+
12
+ function external_function () result(i)
13
+ integer :: i
14
+ i = 1
15
+ end function external_function
Original file line number Diff line number Diff line change
1
+ ! This module is not used by any other sources
2
+ ! and only contains a module (no non-module subprograms),
3
+ ! therefore it should be dropped during tree-shaking/pruning
1
4
module farewell_m
2
5
use subdir_constants, only: FAREWELL_STR
3
6
implicit none
Original file line number Diff line number Diff line change
1
+ ! This module is directly by the executables and
2
+ ! hence should not be dropped during tree-shaking/pruning
1
3
module greet_m
2
4
use subdir_constants, only: GREET_STR
3
5
implicit none
Original file line number Diff line number Diff line change
1
+ ! This module is used indirectly by the executables
2
+ ! and hence should not be dropped during tree-shaking/pruning
1
3
module subdir_constants
2
4
implicit none
3
5
You can’t perform that action at this time.
0 commit comments