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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [func_assign_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
! Test the fix for PR40551 in which the assignment
3
! was not dealing correctly with non-contiguous lhs
4
! references; eg. a(1,:)
5
!
6
! Reported by by Maciej Zwierzycki
7
! at http://gcc.gnu.org/ml/fortran/2009-06/msg00254.html
8
! and by Tobias Burnus  on Bugzilla
9
!
10
integer :: a(2,2)
11
a = -42
12
a(1,:) = func()
13
if (any (reshape (a, [4]) /= [1, -42, 2, -42])) call abort
14
a = -42
15
a(2,:) = func()
16
if (any (reshape (a, [4]) /= [-42, 1, -42, 2])) call abort
17
a = -42
18
a(:,1) = func()
19
if (any (reshape (a, [4]) /= [1, 2, -42, -42])) call abort
20
a = -42
21
a(:,2) = func()
22
if (any (reshape (a, [4]) /= [-42, -42, 1, 2])) call abort
23
contains
24
 function func()
25
   integer :: func(2)
26
   call sub(func)
27
 end function func
28
 subroutine sub(a)
29
   integer :: a(2)
30
   a = [1,2]
31
 end subroutine
32
end
33
 

powered by: WebSVN 2.1.0

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