1 ! Program to test elemental functions.
4 integer(kind = 4), dimension (2, 4) :: a
5 integer(kind = 4), dimension (2, 4) :: b
6 integer(kind = 8), dimension(2) :: c
8 a = reshape ((/2, 3, 4, 5, 6, 7, 8, 9/), (/2, 4/))
10 b(2, :) = e_fn (a(1, :), 1)
11 if (any (b .ne. reshape ((/0, 1, 0, 3, 0, 5, 0, 7/), (/2, 4/)))) call abort
12 a = e_fn (a(:, 4:1:-1), 1 + b)
13 if (any (a .ne. reshape ((/7, 7, 5, 3, 3, -1, 1, -5/), (/2, 4/)))) call abort
14 ! This tests intrinsic elemental conversion functions.
16 if (any (c .ne. 14)) call abort
18 ! This triggered bug due to building ss chains in the wrong order.
21 if (any (a .ne. 0)) call abort
23 ! Check expressions involving constants
25 if (any (a .ne. 0)) call abort
28 elemental integer function e_fn (p, q)
29 integer, intent(in) :: p, q