gcc/testsuite/gfortran.fortran-torture/execute/args.f90
raw| 1 | ! Program to test procudure args |
| 2 | subroutine test (a, b) |
| 3 | integer, intent (IN) :: a |
| 4 | integer, intent (OUT) :: b |
| 5 | |
| 6 | if (a .ne. 42) STOP 1 |
| 7 | b = 43 |
| 8 | end subroutine |
| 9 | |
| 10 | program args |
| 11 | implicit none |
| 12 | external test |
| 13 | integer i, j |
| 14 | |
| 15 | i = 42 |
| 16 | j = 0 |
| 17 | CALL test (i, j) |
| 18 | if (i .ne. 42) STOP 2 |
| 19 | if (j .ne. 43) STOP 3 |
| 20 | i = 41 |
| 21 | CALL test (i + 1, j) |
| 22 | end program |