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_7.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 a, binteger, pointer :: f1, e1allocate (f1)f1 = 15 + areturnentry e1 (b)allocate (e1)e1 = 42 + bend functionfunction f2 ()real, pointer :: f2, e2entry e2 ()allocate (e2)e2 = 45end functionfunction f3 ()double precision, pointer :: f3, e3entry e3 ()allocate (f3)f3 = 47end functionfunction f4 (a) result (r)double precision a, bdouble precision, pointer :: r, sallocate (r)r = 15 + areturnentry e4 (b) result (s)allocate (s)s = 42 + bend functionfunction f5 () result (r)integer, pointer :: r, sentry e5 () result (s)allocate (r)r = 45end functionfunction f6 () result (r)real, pointer :: r, sentry e6 () result (s)allocate (s)s = 47end functionprogram entrytestinterfacefunction f1 (a)integer ainteger, pointer :: f1end functionfunction e1 (b)integer binteger, pointer :: e1end functionfunction f2 ()real, pointer :: f2end functionfunction e2 ()real, pointer :: e2end functionfunction f3 ()double precision, pointer :: f3end functionfunction e3 ()double precision, pointer :: e3end functionfunction f4 (a)double precision adouble precision, pointer :: f4end functionfunction e4 (b)double precision bdouble precision, pointer :: e4end functionfunction f5 ()integer, pointer :: f5end functionfunction e5 ()integer, pointer :: e5end functionfunction f6 ()real, pointer :: f6end functionfunction e6 ()real, pointer :: e6end functionend interfacedouble precision dif (f1 (6) .ne. 21) call abort ()if (e1 (7) .ne. 49) call abort ()if (f2 () .ne. 45) call abort ()if (e2 () .ne. 45) call abort ()if (f3 () .ne. 47) call abort ()if (e3 () .ne. 47) call abort ()d = 17if (f4 (d) .ne. 32) call abort ()if (e4 (d) .ne. 59) call abort ()if (f5 () .ne. 45) call abort ()if (e5 () .ne. 45) call abort ()if (f6 () .ne. 47) call abort ()if (e6 () .ne. 47) call abort ()end
