Debian Codegraph @

gcc/testsuite/gfortran.dg/shape_8.f90

raw
1 ! { dg-do run }
2 !
3 ! Check that we can use SHAPE with optional kind argument
4 !
5 program test
6 implicit none
7 real, allocatable :: x(:,:)
8
9 allocate(x(2,5))
10 if (any(shape(x) /= [ 2, 5 ])) STOP 1
11 if (any(shape(x,kind=1) /= [ 2, 5 ])) STOP 2
12 if (any(shape(x,kind=2) /= [ 2, 5 ])) STOP 3
13 if (any(shape(x,kind=4) /= [ 2, 5 ])) STOP 4
14 if (any(shape(x,kind=8) /= [ 2, 5 ])) STOP 5
15 end