1! Program to test the ABS intrinsic
2program intrinsic_abs
3   implicit none
4   integer i
5   real(kind=4) r
6   real(kind=8) q
7   complex z
8
9   i = 42
10   i = abs(i)
11   if (i .ne. 42) call abort
12   i = -43
13   i = abs(i)
14   if (i .ne. 43) call abort
15
16   r = 42.0
17   r = abs(r)
18   if (r .ne. 42.0) call abort
19   r = -43.0
20   r = abs(r)
21   if (r .ne. 43.0) call abort
22
23   q = 42.0_8
24   q = abs(q)
25   if (q .ne. 42.0_8) call abort
26   q = -43.0_8
27   q = abs(q)
28   if (q .ne. 43.0_8) call abort
29
30   z = (3, 4)
31   r = abs(z)
32   if (r .ne. 5) call abort
33end program
34