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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [intrinsic_sign.f90] - Blame information for rev 774

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

Line No. Rev Author Line
1 695 jeremybenn
! Program to test SIGN intrinsic
2
program intrinsic_sign
3
   implicit none
4
   integer i, j
5
   real r, s
6
 
7
   i = 2
8
   j = 3
9
   if (sign (i, j) .ne. 2) call abort
10
   i = 4
11
   j = -5
12
   if (sign (i, j) .ne. -4) call abort
13
   i = -6
14
   j = 7
15
   if (sign (i, j) .ne. 6) call abort
16
   i = -8
17
   j = -9
18
   if (sign (i, j) .ne. -8) call abort
19
   r = 1
20
   s = 2
21
   if (sign (r, s) .ne. 1) call abort
22
   r = 1
23
   s = -2
24
   if (sign (r, s) .ne. -1) call abort
25
   s = 0
26
   if (sign (r, s) .ne. 1) call abort
27
   ! Will fail on machines which cannot represent negative zero.
28
   s = -s ! Negative zero
29
   if (sign (r, s) .ne. -1) call abort
30
end program
31
 

powered by: WebSVN 2.1.0

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