| 1 | program integer16_internal_stack_call |
| 2 | implicit none |
| 3 | integer(16) :: a, b, c, d, e, r |
| 4 | integer :: score |
| 5 | |
| 6 | a = 1_16 |
| 7 | b = 2_16 |
| 8 | c = 3_16 |
| 9 | d = 4_16 |
| 10 | e = 5_16 |
| 11 | |
| 12 | r = add5(a, b, c, d, e) |
| 13 | |
| 14 | if (r == 15_16) then |
| 15 | score = 1 |
| 16 | else |
| 17 | score = 0 |
| 18 | end if |
| 19 | |
| 20 | print *, score |
| 21 | |
| 22 | contains |
| 23 | |
| 24 | integer(16) function add5(a, b, c, d, e) result(r) |
| 25 | integer(16), value :: a, b, c, d, e |
| 26 | |
| 27 | r = a + b + c + d + e |
| 28 | end function add5 |
| 29 | end program integer16_internal_stack_call |
| 30 |