URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 303 |
Rev 338 |
! Program to test the ABS intrinsic
|
! Program to test the ABS intrinsic
|
program intrinsic_abs
|
program intrinsic_abs
|
implicit none
|
implicit none
|
integer i
|
integer i
|
real(kind=4) r
|
real(kind=4) r
|
real(kind=8) q
|
real(kind=8) q
|
complex z
|
complex z
|
|
|
i = 42
|
i = 42
|
i = abs(i)
|
i = abs(i)
|
if (i .ne. 42) call abort
|
if (i .ne. 42) call abort
|
i = -43
|
i = -43
|
i = abs(i)
|
i = abs(i)
|
if (i .ne. 43) call abort
|
if (i .ne. 43) call abort
|
|
|
r = 42.0
|
r = 42.0
|
r = abs(r)
|
r = abs(r)
|
if (r .ne. 42.0) call abort
|
if (r .ne. 42.0) call abort
|
r = -43.0
|
r = -43.0
|
r = abs(r)
|
r = abs(r)
|
if (r .ne. 43.0) call abort
|
if (r .ne. 43.0) call abort
|
|
|
q = 42.0_8
|
q = 42.0_8
|
q = abs(q)
|
q = abs(q)
|
if (q .ne. 42.0_8) call abort
|
if (q .ne. 42.0_8) call abort
|
q = -43.0_8
|
q = -43.0_8
|
q = abs(q)
|
q = abs(q)
|
if (q .ne. 43.0_8) call abort
|
if (q .ne. 43.0_8) call abort
|
|
|
z = (3, 4)
|
z = (3, 4)
|
r = abs(z)
|
r = abs(z)
|
if (r .ne. 5) call abort
|
if (r .ne. 5) call abort
|
end program
|
end program
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.