URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [entry_6.f90] - Rev 303
Compare with Previous | Blame | View Log
! Test alternate entry points for functions when the result types! of all entry points matchfunction f1 (a)integer, dimension (2, 2) :: a, b, f1, e1f1 (:, :) = 15 + a (1, 1)returnentry e1 (b)e1 (:, :) = 42 + b (1, 1)end functionfunction f2 ()real, dimension (2, 2) :: f2, e2entry e2 ()e2 (:, :) = 45end functionfunction f3 ()double precision, dimension (2, 2) :: a, b, f3, e3entry e3 ()f3 (:, :) = 47end functionfunction f4 (a) result (r)double precision, dimension (2, 2) :: a, b, r, sr (:, :) = 15 + a (1, 1)returnentry e4 (b) result (s)s (:, :) = 42 + b (1, 1)end functionfunction f5 () result (r)integer, dimension (2, 2) :: r, sentry e5 () result (s)r (:, :) = 45end functionfunction f6 () result (r)real, dimension (2, 2) :: r, sentry e6 () result (s)s (:, :) = 47end functionprogram entrytestinterfacefunction f1 (a)integer, dimension (2, 2) :: a, f1end functionfunction e1 (b)integer, dimension (2, 2) :: b, e1end functionfunction f2 ()real, dimension (2, 2) :: f2end functionfunction e2 ()real, dimension (2, 2) :: e2end functionfunction f3 ()double precision, dimension (2, 2) :: f3end functionfunction e3 ()double precision, dimension (2, 2) :: e3end functionfunction f4 (a)double precision, dimension (2, 2) :: a, f4end functionfunction e4 (b)double precision, dimension (2, 2) :: b, e4end functionfunction f5 ()integer, dimension (2, 2) :: f5end functionfunction e5 ()integer, dimension (2, 2) :: e5end functionfunction f6 ()real, dimension (2, 2) :: f6end functionfunction e6 ()real, dimension (2, 2) :: e6end functionend interfaceinteger, dimension (2, 2) :: i, jreal, dimension (2, 2) :: rdouble precision, dimension (2, 2) :: d, ei (:, :) = 6j = f1 (i)if (any (j .ne. 21)) call abort ()i (:, :) = 7j = e1 (i)j (:, :) = 49if (any (j .ne. 49)) call abort ()r = f2 ()if (any (r .ne. 45)) call abort ()r = e2 ()if (any (r .ne. 45)) call abort ()e = f3 ()if (any (e .ne. 47)) call abort ()e = e3 ()if (any (e .ne. 47)) call abort ()d (:, :) = 17e = f4 (d)if (any (e .ne. 32)) call abort ()e = e4 (d)if (any (e .ne. 59)) call abort ()j = f5 ()if (any (j .ne. 45)) call abort ()j = e5 ()if (any (j .ne. 45)) call abort ()r = f6 ()if (any (r .ne. 47)) call abort ()r = e6 ()if (any (r .ne. 47)) call abort ()end
