3 ! This tests that common blocks function with multiply nested modules.
4 ! Contributed by Paul Thomas <pault@gcc.gnu.org>
7 complex(kind
=8) FOO
, KANGA
8 common /bar
/ FOO
, KANGA
11 FOO
= FOO
+ (1.0d0, 0.0d0)
12 KANGA
= KANGA
- (1.0d0, 0.0d0)
23 real(kind
=8) re1
, im1
, re2
, im2
, re
, im
24 common /bar
/ re1
, im1
, re2
, im2
25 equivalence (re1
, re
), (im1
, im
)
29 if (FOO
.ne
.(1.0d0, 1.0d0)) call abort ()
30 if (KANGA
.ne
.(-1.0d0, -1.0d0)) call abort ()
31 if (ROBIN
.ne
.(99.0d0, 99.0d0)) CALL abort ()
32 if (w
.ne
.cmplx(re
,im
)) call abort ()
37 use mod0
, only
: w
=>foo
38 w
= (0.0d0, 1.0d0) ! Was foo but this is forbidden (11.3.2)
39 KANGA
= (0.0d0, -1.0d0)
40 ROBIN
= (99.0d0, 99.0d0)
45 ! { dg-final { cleanup-modules "mod0 mod1 mod2" } }