2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / module_equivalence_2.f90
blob3ec8efb41a41db3497fc3ea2ba05d2261314f911
1 ! { dg-do run }
2 ! Tests the fix for PR27269 and PR27xxx.
3 ! The former caused a segfault in trying to process
4 ! module b, with an unused equivalence in a. The latter
5 ! produced an assembler error due to multiple declarations
6 ! for a module equivalence, when one of the variables was
7 ! initialized, as M in module a.
9 module a
10 integer, parameter :: dp = selected_real_kind (10)
11 real(dp) :: reM, M = 1.77d0
12 equivalence (M, reM)
13 end module a
15 module b
16 use a, only : dp
17 end module b
19 use a
20 use b
21 if (reM .ne. 1.77d0) call abort ()
22 reM = 0.57d1
23 if (M .ne. 0.57d1) call abort ()
24 end