]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/testsuite/gfortran.dg/intrinsic_spread_1.f90
re PR libfortran/32972 (performance of pack/unpack)
[thirdparty/gcc.git] / gcc / testsuite / gfortran.dg / intrinsic_spread_1.f90
index 1fe09d478bb5f75416d8ebde240cb5ebb58b866a..04e4c577ac62857efd748a47c73e8fb3c6339ece 100644 (file)
@@ -25,6 +25,14 @@ program foo
    complex(kind=8), dimension (10) :: c_8
    complex(kind=8), dimension (2, 3) :: ac_8
    complex(kind=8), dimension (2, 2, 3) :: bc_8
+   type i4_t
+      integer(kind=4) :: v
+   end type i4_t
+   type(i4_t), dimension (10) :: it_4
+   type(i4_t), dimension (2, 3) :: at_4
+   type(i4_t), dimension (2, 2, 3) :: bt_4
+   type(i4_t) :: iv_4
+
    character (len=200) line1, line2, line3
 
    a_1 = reshape ((/1_1, 2_1, 3_1, 4_1, 5_1, 6_1/), (/2, 3/))
@@ -159,6 +167,17 @@ program foo
    c_8 = spread((1._8,-1._8),1,10)
    if (any(c_8 /= (1._8,-1._8))) call abort
 
+
+   at_4%v = reshape ((/1_4, 2_4, 3_4, 4_4, 5_4, 6_4/), (/2, 3/))
+   bt_4 = spread (at_4, 1, 2)
+   if (any (bt_4%v .ne. reshape ((/1_4, 1_4, 2_4, 2_4, 3_4, 3_4, 4_4, &
+        & 4_4, 5_4, 5_4, 6_4, 6_4/), (/2, 2, 3/)))) &
+      call abort
+   iv_4%v = 123_4
+   it_4 = spread(iv_4,1,10)
+   if (any(it_4%v /= 123_4)) call abort
+
+
 9000 format(12I3)
 9010 format(12F7.3)
 9020 format(25F7.3)