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

Subversion Repositories openrisc

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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! Tests that the in-memory representation of a transferred variable
3
! propagates properly.
4
!
5
  implicit none
6
 
7
  integer, parameter :: ip1 = 42
8
  integer, parameter :: ip2 = transfer(transfer(ip1, .true.), 0)
9
  integer :: i, ai(4)
10
  logical :: b
11
 
12
  if (ip2 .ne. ip1) call abort ()
13
 
14
  i = transfer(transfer(ip1, .true.), 0)
15
  if (i .ne. ip1) call abort ()
16
 
17
  i = 42
18
  i = transfer(transfer(i, .true.), 0)
19
  if (i .ne. ip1) call abort ()
20
 
21
  b = transfer(transfer(.true., 3.1415), .true.)
22
  if (.not.b) call abort ()
23
 
24
  b = transfer(transfer(.false., 3.1415), .true.)
25
  if (b) call abort ()
26
 
27
  i = 0
28
  b = transfer(i, .true.)
29
  ! The standard doesn't guarantee here that b will be .false.,
30
  ! though in gfortran for all targets it will.
31
 
32
  ai = (/ 42, 42, 42, 42 /)
33
  ai = transfer (transfer (ai, .false., 4), ai)
34
  if (any(ai .ne. 42)) call abort
35
 
36
  ai = transfer (transfer ((/ 42, 42, 42, 42 /), &
37
&                          (/ .false., .false., .false., .false. /)), ai)
38
  if (any(ai .ne. 42)) call abort
39
end

powered by: WebSVN 2.1.0

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