hppa64: Fix fmt_f_default_field_width_3.f90 and fmt_g_default_field_width_3.f90
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr102685.f90
blobd325c27b32ac0881414e803799a64740eb2f8be5
1 ! { dg-do compile }
2 ! PR fortran/102685
4 program p
5 type t
6 integer :: a(2)
7 end type
8 type(t), parameter :: x0 = t([2]) ! { dg-error "shape of component" }
9 type(t), parameter :: x1(2) = t([2]) ! { dg-error "shape of component" }
10 type(t), parameter :: x(2) = t([integer::]) ! { dg-error "shape of component" }
12 type u
13 integer :: a
14 integer :: b(0)
15 end type
16 type(u), parameter :: z0(2) = u(1, [integer::]) ! valid
17 type(u), parameter :: z1 = u(1, 2 ) ! valid
18 type(u), parameter :: z2(2) = u(1, 2 ) ! valid
19 type(u), parameter :: z3 = u(1, [2]) ! { dg-error "shape of component" }
20 type(u), parameter :: z4(2) = u(1, [2]) ! { dg-error "shape of component" }
22 type v
23 integer :: a(2,1)
24 end type
25 type(v), parameter :: y0 = v(reshape([1,2],[2,1])) ! valid
26 type(v), parameter :: y1 = v(reshape([1,2],[1,2])) ! { dg-error "shape of component" }
27 type(v), parameter :: y(1) = v(reshape([1,2],[1,2])) ! { dg-error "shape of component" }
29 print *, x0,x,x1,y0,y1,y,z0,z1,z2,z3,z4
30 end