modula2: Simplify REAL/LONGREAL/SHORTREAL node creation.
[official-gcc.git] / gcc / testsuite / gfortran.dg / inquiry_type_ref_5.f90
blobb27943ae496fea018164030a5f93e3b7f25144f8
1 ! { dg-do run }
3 ! Test the fix for pr92753
5 ! Contributed by Gerhardt Steinmetz <gscfq@t-online.de>
7 module m
8 type t
9 character(3) :: c
10 end type
11 type u
12 complex :: z
13 end type
14 type(t), parameter :: x = t ('abc')
15 integer, parameter :: l = x%c%len ! Used to ICE
17 type(u), parameter :: z = u ((42.0,-42.0))
18 end
19 program p
20 use m
21 call s (x%c%len) ! ditto
23 if (int (z%z%re) .ne. 42) stop 1 ! Produced wrong code and
24 if (int (z%z%re) .ne. -int (z%z%im)) stop 2 ! runtime seg fault
25 contains
26 subroutine s(n)
27 if (n .ne. l) stop 3
28 end
29 end