OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [intrinsic_spread_2.f90] - Blame information for rev 694

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! { dg-require-effective-target fortran_large_real }
3
program foo
4
   implicit none
5
   integer,parameter :: k = selected_real_kind (precision (0.0_8) + 1)
6
 
7
   real(kind=k), dimension(10) :: r_k
8
   real(kind=k), dimension (2, 3) :: ar_k
9
   real(kind=k), dimension (2, 2, 3) :: br_k
10
   complex(kind=k), dimension(10) :: c_k
11
   complex(kind=k), dimension (2, 3) :: ac_k
12
   complex(kind=k), dimension (2, 2, 3) :: bc_k
13
   character (len=200) line1, line2, line3
14
 
15
   ar_k = reshape ((/1._k, 2._k, 3._k, 4._k, 5._k, 6._k/), (/2, 3/))
16
   br_k = spread (ar_k, 1, 2)
17
   if (any (br_k .ne. reshape ((/1._k, 1._k, 2._k, 2._k, 3._k, 3._k, &
18
   & 4._k, 4._k, 5._k, 5._k, 6._k, 6._k/), (/2, 2, 3/)))) call abort
19
   line1 = ' '
20
   write(line1, 9010) br_k
21
   line2 = ' '
22
   write(line2, 9010) spread (ar_k, 1, 2)
23
   if (line1 /= line2) call abort
24
   line3 = ' '
25
   write(line3, 9010) spread (ar_k, 1, 2) + 0._k
26
   if (line1 /= line3) call abort
27
   r_k = spread(1._k,1,10)
28
   if (any(r_k /= 1._k)) call abort
29
 
30
   ac_k = reshape ((/(1._k,-1._k), (2._k,-2._k), (3._k, -3._k), (4._k, -4._k), &
31
                   & (5._k,-5._k), (6._k,-6._k)/), (/2, 3/))
32
   bc_k = spread (ac_k, 1, 2)
33
   if (any (real(bc_k) .ne. reshape ((/1._k, 1._k, 2._k, 2._k, 3._k, 3._k, &
34
   & 4._k, 4._k, 5._k, 5._k, 6._k, 6._k/), (/2, 2, 3/)))) call abort
35
   if (any (-aimag(bc_k) .ne. reshape ((/1._k, 1._k, 2._k, 2._k, 3._k, 3._k, &
36
   & 4._k, 4._k, 5._k, 5._k, 6._k, 6._k/), (/2, 2, 3/)))) call abort
37
   line1 = ' '
38
   write(line1, 9020) bc_k
39
   line2 = ' '
40
   write(line2, 9020) spread (ac_k, 1, 2)
41
   if (line1 /= line2) call abort
42
   line3 = ' '
43
   write(line3, 9020) spread (ac_k, 1, 2) + 0._k
44
   if (line1 /= line3) call abort
45
   c_k = spread((1._k,-1._k),1,10)
46
   if (any(c_k /= (1._k,-1._k))) call abort
47
 
48
9010 format(12F7.3)
49
9020 format(25F7.3)
50
 
51
end program

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.