gcc/testsuite/gfortran.fortran-torture/execute/entry_9.f90
raw| 1 | ! Test alternate entry points for functions when the result types |
| 2 | ! of all entry points match |
| 3 | |
| 4 | function f1 (a) |
| 5 | integer a, f1, e1 |
| 6 | f1 = 15 + a |
| 7 | return |
| 8 | entry e1 |
| 9 | e1 = 42 |
| 10 | end function |
| 11 | function f2 () |
| 12 | real f2, e2 |
| 13 | entry e2 |
| 14 | e2 = 45 |
| 15 | end function |
| 16 | |
| 17 | program entrytest |
| 18 | integer f1, e1 |
| 19 | real f2, e2 |
| 20 | if (f1 (6) .ne. 21) STOP 1 |
| 21 | if (e1 () .ne. 42) STOP 2 |
| 22 | if (f2 () .ne. 45) STOP 3 |
| 23 | if (e2 () .ne. 45) STOP 4 |
| 24 | end |