Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gfortran.fortran-torture / execute / intrinsic_sign.f90
blobfbc457d917c02afd98a014d677cd7a52ff7449de
1 ! Program to test SIGN intrinsic
2 program intrinsic_sign
3 implicit none
4 integer i, j
5 real r, s
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