1! { dg-do compile }
2! { dg-options "-fwhole-file" }
3! Test the fix for pr40011 comment #42, in which the subroutine
4! would just get lost with -fwhole-file.
5!
6! Contributed by Joost VandeVandole <jv244@cam.ac.uk>
7!
8SUBROUTINE c()
9 CALL a()
10END SUBROUTINE c
11
12SUBROUTINE a()
13END SUBROUTINE a
14
15MODULE M
16CONTAINS
17 SUBROUTINE b()
18   CALL c()
19 END SUBROUTINE
20END MODULE
21
22USE M
23CALL b()
24END
25